public class

SignerInformation

extends Object
java.lang.Object
   ↳ org.bouncycastle.cms.SignerInformation

Class Overview

an expanded SignerInfo block from a CMS Signed message

Summary

Public Methods
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.
byte[] getDigestAlgParams()
return the signature parameters, or null if there aren't any.
AlgorithmIdentifier getDigestAlgorithmID()
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()
This method is deprecated. use toASN1Structure()
boolean verify(X509Certificate cert, String sigProvider)
This method is deprecated. use verify(ContentVerifierProvider)
boolean verify(PublicKey key, Provider sigProvider)
This method is deprecated. use verify(ContentVerifierProvider)
boolean verify(X509Certificate cert, Provider sigProvider)
This method is deprecated. use verify(ContentVerifierProvider)
boolean verify(SignerInformationVerifier verifier)
Verify that the given verifier can successfully verify the signature on this SignerInformation object.
boolean verify(PublicKey key, String sigProvider)
This method is deprecated. use verify(ContentVerifierProvider)
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static SignerInformation addCounterSigners (SignerInformation signerInformation, SignerInformationStore counterSigners)

Return a signer information object with passed in SignerInformationStore representing counter signatures attached as an unsigned attribute.

Parameters
signerInformation the signerInfo to be used as the basis.
counterSigners signer info objects carrying counter signature.
Returns
  • a copy of the original SignerInformationObject with the changed attributes.

public byte[] getContentDigest ()

return the content digest that was calculated during verification.

public ASN1ObjectIdentifier getContentType ()

public SignerInformationStore getCounterSignatures ()

Return a SignerInformationStore containing the counter signatures attached to this signer. If no counter signatures are present an empty store is returned.

public String getDigestAlgOID ()

return the object identifier for the signature.

public byte[] getDigestAlgParams ()

return the signature parameters, or null if there aren't any.

public AlgorithmIdentifier getDigestAlgorithmID ()

public byte[] getEncodedSignedAttributes ()

return the DER encoding of the signed attributes.

Throws
IOException if an encoding error occurs.

public String getEncryptionAlgOID ()

return the object identifier for the signature.

public byte[] getEncryptionAlgParams ()

return the signature/encryption algorithm parameters, or null if there aren't any.

public SignerId getSID ()

public byte[] getSignature ()

return the encoded signature

public AttributeTable getSignedAttributes ()

return a table of the signed attributes - indexed by the OID of the attribute.

public AttributeTable getUnsignedAttributes ()

return a table of the unsigned attributes indexed by the OID of the attribute.

public int getVersion ()

return the version number for this objects underlying SignerInfo structure.

public boolean isCounterSignature ()

public 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.

Parameters
signerInformation the signerInfo to be used as the basis.
unsignedAttributes the unsigned attributes to add.
Returns
  • a copy of the original SignerInformationObject with the changed attributes.

public SignerInfo toASN1Structure ()

Return the underlying ASN.1 object defining this SignerInformation object.

Returns
  • a SignerInfo.

public SignerInfo toSignerInfo ()

This method is deprecated.
use toASN1Structure()

Return the base ASN.1 CMS structure that this object contains.

Returns
  • an object containing a CMS SignerInfo structure.

public boolean verify (X509Certificate cert, String sigProvider)

This method is deprecated.
use verify(ContentVerifierProvider)

verify that the given certificate successfully handles and confirms the signature associated with this signer and, if a signingTime attribute is available, that the certificate was valid at the time the signature was generated.

public boolean verify (PublicKey key, Provider sigProvider)

This method is deprecated.
use verify(ContentVerifierProvider)

verify that the given public key successfully handles and confirms the signature associated with this signer

public boolean verify (X509Certificate cert, Provider sigProvider)

This method is deprecated.
use verify(ContentVerifierProvider)

verify that the given certificate successfully handles and confirms the signature associated with this signer and, if a signingTime attribute is available, that the certificate was valid at the time the signature was generated.

public boolean verify (SignerInformationVerifier verifier)

Verify that the given verifier can successfully verify the signature on this SignerInformation object.

Parameters
verifier a suitably configured SignerInformationVerifier.
Returns
  • true if the signer information is verified, false otherwise.
Throws
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 boolean verify (PublicKey key, String sigProvider)

This method is deprecated.
use verify(ContentVerifierProvider)

verify that the given public key successfully handles and confirms the signature associated with this signer.