@License public class PKCS7Signer extends Signer
alias, encapsulate, keyring, provider| 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 |
|---|---|
byte[] |
sign(byte[] data)
Signs the given byte array, returning the signed version.
|
void |
sign(InputStream input,
OutputStream output)
Signs whatever can be read from the given input stream, writing the signed
version into the given output stream.
|
isEncapsulateData, setEncapsulateDatapublic PKCS7Signer(String alias, KeyRing keyring, Provider provider, SignatureAlgorithm algorithm) throws CryptoException, KeyStoreException, CertificateEncodingException, CertificateNotYetValidException, CertificateExpiredException
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.KeyStoreExceptionCertificateEncodingExceptionCertificateNotYetValidExceptionCertificateExpiredExceptionpublic PKCS7Signer(String alias, KeyRing keyring, Provider provider, String digest, String encryption) throws CryptoException, CertificateEncodingException, CertificateNotYetValidException, KeyStoreException, CertificateExpiredException
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.KeyStoreExceptionCertificateNotYetValidExceptionCertificateEncodingExceptionCertificateExpiredExceptionpublic byte[] sign(byte[] data)
throws CryptoException
sign in class Signerdata - the array of bytes to sign.CryptoExceptionpublic void sign(InputStream input, OutputStream output) throws CryptoException
sign in class Signerinput - an input stream from which data to be signed can be read.output - an output stream into which signed data will be written.CryptoExceptionCopyright © 2012-2014 Andrea Funtò. See here for terms and conditions.