org.bouncycastle.cms

Class SignerInformation

public class SignerInformation extends Object

an expanded SignerInfo block from a CMS Signed message
Method Summary
byte[]getContentDigest()
return the content digest that was calculated during verification.
StringgetDigestAlgOID()
return the object identifier for the signature.
byte[]getDigestAlgParams()
return the signature parameters, or null if there aren't any.
byte[]getEncodedSignedAttributes()
return the DER encoding of the signed attributes.
StringgetEncryptionAlgOID()
return the object identifier for the signature.
byte[]getEncryptionAlgParams()
return the signature/encyrption algorithm parameters, or null if there aren't any.
byte[]getSignature()
return the encoded signature
AttributeTablegetSignedAttributes()
return a table of the signed attributes - indexed by the OID of the attribute.
SignerIdgetSID()
AttributeTablegetUnsignedAttributes()
return a table of the unsigned attributes indexed by the OID of the attribute.
intgetVersion()
return the version number for this objects underlying SignerInfo structure.
static SignerInformationreplaceUnsignedAttributes(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.
SignerInfotoSignerInfo()
Return the base ASN.1 CMS structure that this object contains.
booleanverify(PublicKey key, String sigProvider)
verify that the given public key succesfully handles and confirms the signature associated with this signer.
booleanverify(X509Certificate cert, String sigProvider)
verify that the given certificate succesfully 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.

Method Detail

getContentDigest

public byte[] getContentDigest()
return the content digest that was calculated during verification.

getDigestAlgOID

public String getDigestAlgOID()
return the object identifier for the signature.

getDigestAlgParams

public byte[] getDigestAlgParams()
return the signature parameters, or null if there aren't any.

getEncodedSignedAttributes

public byte[] getEncodedSignedAttributes()
return the DER encoding of the signed attributes.

Throws: IOException if an encoding error occurs.

getEncryptionAlgOID

public String getEncryptionAlgOID()
return the object identifier for the signature.

getEncryptionAlgParams

public byte[] getEncryptionAlgParams()
return the signature/encyrption algorithm parameters, or null if there aren't any.

getSignature

public byte[] getSignature()
return the encoded signature

getSignedAttributes

public AttributeTable getSignedAttributes()
return a table of the signed attributes - indexed by the OID of the attribute.

getSID

public SignerId getSID()

getUnsignedAttributes

public AttributeTable getUnsignedAttributes()
return a table of the unsigned attributes indexed by the OID of the attribute.

getVersion

public int getVersion()
return the version number for this objects underlying SignerInfo structure.

replaceUnsignedAttributes

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.

toSignerInfo

public SignerInfo toSignerInfo()
Return the base ASN.1 CMS structure that this object contains.

Returns: an object containing a CMS SignerInfo structure.

verify

public boolean verify(PublicKey key, String sigProvider)
verify that the given public key succesfully handles and confirms the signature associated with this signer.

verify

public boolean verify(X509Certificate cert, String sigProvider)
verify that the given certificate succesfully 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.