Class SignerInformation
-
- All Implemented Interfaces:
public class SignerInformation
an expanded SignerInfo block from a CMS Signed message
-
-
Field Summary
Fields Modifier and Type Field Description public final SignerId
sid
public final Array<byte>
signature
public final ASN1ObjectIdentifier
contentType
public final boolean
isCounterSignature
-
Method Summary
Modifier and Type Method Description SignerId
getSID()
Array<byte>
getSignature()
return the encoded signature ASN1ObjectIdentifier
getContentType()
boolean
isCounterSignature()
int
getVersion()
return the version number for this objects underlying SignerInfo structure. AlgorithmIdentifier
getDigestAlgorithmID()
String
getDigestAlgOID()
return the object identifier for the signature. Array<byte>
getDigestAlgParams()
return the signature parameters, or null if there aren't any. Array<byte>
getContentDigest()
return the content digest that was calculated during verification. String
getEncryptionAlgOID()
return the object identifier for the signature. Array<byte>
getEncryptionAlgParams()
return the signature/encryption algorithm parameters, or null if there aren't any. 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. SignerInformationStore
getCounterSignatures()
Return a SignerInformationStore containing the counter signatures attached to this signer. Array<byte>
getEncodedSignedAttributes()
return the DER encoding of the signed attributes. boolean
verify(SignerInformationVerifier verifier)
Verify that the given verifier can successfully verify the signature on this SignerInformation object. SignerInfo
toASN1Structure()
Return the underlying ASN.1 object defining this SignerInformation object. 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. static SignerInformation
addCounterSigners(SignerInformation signerInformation, SignerInformationStore counterSigners)
Return a signer information object with passed in SignerInformationStore representing counter signatures attached as an unsigned attribute. -
-
Method Detail
-
getSignature
Array<byte> getSignature()
return the encoded signature
-
getContentType
ASN1ObjectIdentifier getContentType()
-
isCounterSignature
boolean isCounterSignature()
-
getVersion
int getVersion()
return the version number for this objects underlying SignerInfo structure.
-
getDigestAlgorithmID
AlgorithmIdentifier getDigestAlgorithmID()
-
getDigestAlgOID
String getDigestAlgOID()
return the object identifier for the signature.
-
getDigestAlgParams
Array<byte> getDigestAlgParams()
return the signature parameters, or null if there aren't any.
-
getContentDigest
Array<byte> getContentDigest()
return the content digest that was calculated during verification.
-
getEncryptionAlgOID
String getEncryptionAlgOID()
return the object identifier for the signature.
-
getEncryptionAlgParams
Array<byte> getEncryptionAlgParams()
return the signature/encryption algorithm parameters, or null if there aren't any.
-
getSignedAttributes
AttributeTable getSignedAttributes()
return a table of the signed attributes - indexed by the OID of the attribute.
-
getUnsignedAttributes
AttributeTable getUnsignedAttributes()
return a table of the unsigned attributes indexed by the OID of the attribute.
-
getCounterSignatures
SignerInformationStore getCounterSignatures()
Return a SignerInformationStore containing the counter signatures attached to this signer. If no counter signatures are present an empty store is returned.
-
getEncodedSignedAttributes
Array<byte> getEncodedSignedAttributes()
return the DER encoding of the signed attributes.
-
verify
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.
-
toASN1Structure
SignerInfo toASN1Structure()
Return the underlying ASN.1 object defining this SignerInformation object.
- Returns:
a SignerInfo.
-
replaceUnsignedAttributes
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.
-
addCounterSigners
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.
-
-
-
-