public class SignerInformation extends Object
Modifier and Type | Method and Description |
---|---|
static SignerInformation |
addCounterSigners(SignerInformation signerInformation,
SignerInformationStore counterSigners)
Return a signer information object with passed in SignerInformationStore representing counter
signatures attached as an unsigned attribute.
|
byte[] |
getContentDigest()
return the content digest that was calculated during verification.
|
ASN1ObjectIdentifier |
getContentType() |
SignerInformationStore |
getCounterSignatures()
Return a SignerInformationStore containing the counter signatures attached to this
signer.
|
String |
getDigestAlgOID()
return the object identifier for the signature.
|
AlgorithmIdentifier |
getDigestAlgorithmID() |
byte[] |
getDigestAlgParams()
return the signature parameters, or null if there aren't any.
|
byte[] |
getEncodedSignedAttributes()
return the DER encoding of the signed attributes.
|
String |
getEncryptionAlgOID()
return the object identifier for the signature.
|
byte[] |
getEncryptionAlgParams()
return the signature/encryption algorithm parameters, or null if
there aren't any.
|
SignerId |
getSID() |
byte[] |
getSignature()
return the encoded signature
|
AttributeTable |
getSignedAttributes()
return a table of the signed attributes - indexed by
the OID of the attribute.
|
AttributeTable |
getUnsignedAttributes()
return a table of the unsigned attributes indexed by
the OID of the attribute.
|
int |
getVersion()
return the version number for this objects underlying SignerInfo structure.
|
boolean |
isCounterSignature() |
static SignerInformation |
replaceUnsignedAttributes(SignerInformation signerInformation,
AttributeTable unsignedAttributes)
Return a signer information object with the passed in unsigned
attributes replacing the ones that are current associated with
the object passed in.
|
SignerInfo |
toASN1Structure()
Return the underlying ASN.1 object defining this SignerInformation object.
|
SignerInfo |
toSignerInfo()
Deprecated.
use toASN1Structure()
|
boolean |
verify(PublicKey key,
Provider sigProvider)
Deprecated.
use verify(ContentVerifierProvider)
|
boolean |
verify(PublicKey key,
String sigProvider)
Deprecated.
use verify(ContentVerifierProvider)
|
boolean |
verify(SignerInformationVerifier verifier)
Verify that the given verifier can successfully verify the signature on
this SignerInformation object.
|
boolean |
verify(X509Certificate cert,
Provider sigProvider)
Deprecated.
use verify(ContentVerifierProvider)
|
boolean |
verify(X509Certificate cert,
String sigProvider)
Deprecated.
use verify(ContentVerifierProvider)
|
public boolean isCounterSignature()
public ASN1ObjectIdentifier getContentType()
public SignerId getSID()
public int getVersion()
public AlgorithmIdentifier getDigestAlgorithmID()
public String getDigestAlgOID()
public byte[] getDigestAlgParams()
public byte[] getContentDigest()
public String getEncryptionAlgOID()
public byte[] getEncryptionAlgParams()
public AttributeTable getSignedAttributes()
public AttributeTable getUnsignedAttributes()
public byte[] getSignature()
public SignerInformationStore getCounterSignatures()
public byte[] getEncodedSignedAttributes() throws IOException
IOException
- if an encoding error occurs.public boolean verify(PublicKey key, String sigProvider) throws NoSuchAlgorithmException, NoSuchProviderException, CMSException
public boolean verify(PublicKey key, Provider sigProvider) throws NoSuchAlgorithmException, NoSuchProviderException, CMSException
public boolean verify(X509Certificate cert, String sigProvider) throws NoSuchAlgorithmException, NoSuchProviderException, CertificateExpiredException, CertificateNotYetValidException, CMSException
public boolean verify(X509Certificate cert, Provider sigProvider) throws NoSuchAlgorithmException, CertificateExpiredException, CertificateNotYetValidException, CMSException
public boolean verify(SignerInformationVerifier verifier) throws CMSException
verifier
- a suitably configured SignerInformationVerifier.CMSVerifierCertificateNotValidException
- if the provider has an associated certificate and the certificate is not valid at the time given as the SignerInfo's signing time.CMSException
- if the verifier is unable to create a ContentVerifiers or DigestCalculators.public SignerInfo toSignerInfo()
public SignerInfo toASN1Structure()
public static SignerInformation replaceUnsignedAttributes(SignerInformation signerInformation, AttributeTable unsignedAttributes)
signerInformation
- the signerInfo to be used as the basis.unsignedAttributes
- the unsigned attributes to add.public static SignerInformation addCounterSigners(SignerInformation signerInformation, SignerInformationStore counterSigners)
signerInformation
- the signerInfo to be used as the basis.counterSigners
- signer info objects carrying counter signature.Copyright © 2015. All rights reserved.