public class PKCS7Signer extends Signer
| Constructor and Description |
|---|
PKCS7Signer(String alias,
KeyRing keyring,
Provider provider,
SignatureAlgorithm algorithm)
Constructor.
|
PKCS7Signer(String alias,
KeyRing keyring,
Provider provider,
String digest,
String encryption)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
initialise()
Initialises the object.
|
byte[] |
sign(byte[] data)
Signs the given set of data.
|
boolean |
verify(byte[] signed)
Verifies the signature of the given set of encapsulated data.
|
boolean |
verify(byte[] signed,
byte[] data)
Verifies the signature of the given set of detached data.
|
getAlias, getKeyRing, getProvider, isEncapsulateDatapublic PKCS7Signer(String alias, KeyRing keyring, Provider provider, SignatureAlgorithm algorithm) throws CryptoException
alias - the alias of the certificate to be used for signing.keyring - the key ring containing the private key used for signing.provider - the security provider backing up the key ring functionalities.algorithm - the digest and encryption algorithm combination used to create the
signature.CryptoException - if any among alias, key ring and provider is null.public PKCS7Signer(String alias, KeyRing keyring, Provider provider, String digest, String encryption) throws CryptoException
alias - the alias of the certificate to be used for signing.keyring - the key ring containing the private key used for signing.provider - the security provider backing up the key ring functionalities.digest - the algorithm used to hash the data.encryption - the algorithm used to encrypt the hash.CryptoException - if any among alias, key ring and provider is null.public void initialise()
throws CryptoException
Signerinitialise in class SignerCryptoException - if anything went wrong accessing, opening or interpreting the keystore.public byte[] sign(byte[] data)
throws CryptoException
Signersign in class Signerdata - the data to be signed.CryptoExceptionpublic boolean verify(byte[] signed)
throws CryptoException
Signerverify in class Signersigned - the encapsulated data.CryptoExceptionpublic boolean verify(byte[] signed,
byte[] data)
throws CryptoException
Signerverify in class Signersigned - the detached data whose signature is to be verified.data - the original, plain text data.CryptoExceptionCopyright © 2012-2014 Andrea Funtò. See here for terms and conditions.