Package org.xwiki.crypto.pkix
Class CertifyingSigner
- java.lang.Object
-
- org.xwiki.crypto.pkix.CertifyingSigner
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
generate()
byte[]
generate(byte[] input)
byte[]
generate(byte[] input, int inputOffset, int inputLen)
org.bouncycastle.asn1.x509.AlgorithmIdentifier
getAlgorithmIdentifier()
String
getAlgorithmName()
CertifiedPublicKey
getCertifier()
byte[]
getEncoded()
FilterInputStream
getInputStream(InputStream is)
static CertifyingSigner
getInstance(boolean forSigning, CertifiedKeyPair certifier, SignerFactory factory)
Get a certifying signer instance from the given signer factory for a given certifier.OutputStream
getOutputStream()
byte[]
getSignature()
boolean
isForSigning()
void
update(byte input)
void
update(byte[] input)
void
update(byte[] input, int inputOffset, int inputLen)
boolean
verify(byte[] signature)
boolean
verify(byte[] signature, byte[] input)
boolean
verify(byte[] signature, int signOffset, int signLen, byte[] input, int inputOffset, int inputLen)
-
-
-
Method Detail
-
getInstance
public static CertifyingSigner getInstance(boolean forSigning, CertifiedKeyPair certifier, SignerFactory factory)
Get a certifying signer instance from the given signer factory for a given certifier.- Parameters:
forSigning
- true for signing, and false for verifying.certifier
- the certified key pair of the certifier.factory
- a signer factory to create the signer.- Returns:
- a certifying signer.
-
getCertifier
public CertifiedPublicKey getCertifier()
- Returns:
- the certified public key of the certifier.
-
getAlgorithmName
public String getAlgorithmName()
- Specified by:
getAlgorithmName
in interfaceSigner
-
isForSigning
public boolean isForSigning()
- Specified by:
isForSigning
in interfaceSigner
-
getInputStream
public FilterInputStream getInputStream(InputStream is)
- Specified by:
getInputStream
in interfaceSigner
-
getOutputStream
public OutputStream getOutputStream()
- Specified by:
getOutputStream
in interfaceorg.bouncycastle.operator.ContentSigner
- Specified by:
getOutputStream
in interfaceSigner
-
update
public void update(byte[] input, int inputOffset, int inputLen)
-
generate
public byte[] generate() throws GeneralSecurityException
- Specified by:
generate
in interfaceSigner
- Throws:
GeneralSecurityException
-
generate
public byte[] generate(byte[] input) throws GeneralSecurityException
- Specified by:
generate
in interfaceSigner
- Throws:
GeneralSecurityException
-
generate
public byte[] generate(byte[] input, int inputOffset, int inputLen) throws GeneralSecurityException
- Specified by:
generate
in interfaceSigner
- Throws:
GeneralSecurityException
-
verify
public boolean verify(byte[] signature) throws GeneralSecurityException
- Specified by:
verify
in interfaceSigner
- Throws:
GeneralSecurityException
-
verify
public boolean verify(byte[] signature, byte[] input) throws GeneralSecurityException
- Specified by:
verify
in interfaceSigner
- Throws:
GeneralSecurityException
-
verify
public boolean verify(byte[] signature, int signOffset, int signLen, byte[] input, int inputOffset, int inputLen) throws GeneralSecurityException
- Specified by:
verify
in interfaceSigner
- Throws:
GeneralSecurityException
-
getEncoded
public byte[] getEncoded()
- Specified by:
getEncoded
in interfaceSigner
-
getAlgorithmIdentifier
public org.bouncycastle.asn1.x509.AlgorithmIdentifier getAlgorithmIdentifier()
- Specified by:
getAlgorithmIdentifier
in interfaceorg.bouncycastle.operator.ContentSigner
- Since:
- 6.0M1
-
getSignature
public byte[] getSignature()
- Specified by:
getSignature
in interfaceorg.bouncycastle.operator.ContentSigner
- Since:
- 6.0M1
-
-