Package org.bouncycastle.asn1.cms
Class SignerInfo
- java.lang.Object
-
- org.bouncycastle.asn1.ASN1Object
-
- org.bouncycastle.asn1.cms.SignerInfo
-
- All Implemented Interfaces:
ASN1Encodable,Encodable
public class SignerInfo extends ASN1Object
RFC 5652: Signature container per Signer, seeSignerIdentifier.PKCS#7: SignerInfo ::= SEQUENCE { version Version, sid SignerIdentifier, digestAlgorithm DigestAlgorithmIdentifier, authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL, digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier, encryptedDigest EncryptedDigest, unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL } EncryptedDigest ::= OCTET STRING DigestAlgorithmIdentifier ::= AlgorithmIdentifier DigestEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier ----------------------------------------- RFC 5652: SignerInfo ::= SEQUENCE { version CMSVersion, sid SignerIdentifier, digestAlgorithm DigestAlgorithmIdentifier, signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL, signatureAlgorithm SignatureAlgorithmIdentifier, signature SignatureValue, unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL } --SignerIdentifierreferenced certificates are at containing --SignedDatacertificates element. SignerIdentifier ::= CHOICE { issuerAndSerialNumberIssuerAndSerialNumber, subjectKeyIdentifier [0] SubjectKeyIdentifier } -- SeeAttributesfor generalized SET OFAttributeSignedAttributes ::= SET SIZE (1..MAX) OF Attribute UnsignedAttributes ::= SET SIZE (1..MAX) OF AttributeAttribute::= SEQUENCE { attrType OBJECT IDENTIFIER, attrValues SET OF AttributeValue } AttributeValue ::= ANY SignatureValue ::= OCTET STRING
-
-
Constructor Summary
Constructors Constructor Description SignerInfo(ASN1Sequence seq)Deprecated.use getInstance() method.SignerInfo(SignerIdentifier sid, AlgorithmIdentifier digAlgorithm, ASN1Set authenticatedAttributes, AlgorithmIdentifier digEncryptionAlgorithm, ASN1OctetString encryptedDigest, ASN1Set unauthenticatedAttributes)SignerInfo(SignerIdentifier sid, AlgorithmIdentifier digAlgorithm, Attributes authenticatedAttributes, AlgorithmIdentifier digEncryptionAlgorithm, ASN1OctetString encryptedDigest, Attributes unauthenticatedAttributes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ASN1SetgetAuthenticatedAttributes()AlgorithmIdentifiergetDigestAlgorithm()AlgorithmIdentifiergetDigestEncryptionAlgorithm()ASN1OctetStringgetEncryptedDigest()static SignerInfogetInstance(java.lang.Object o)Return a SignerInfo object from the given inputSignerIdentifiergetSID()ASN1SetgetUnauthenticatedAttributes()ASN1IntegergetVersion()ASN1PrimitivetoASN1Primitive()Produce an object suitable for an ASN1OutputStream.-
Methods inherited from class org.bouncycastle.asn1.ASN1Object
encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode
-
-
-
-
Constructor Detail
-
SignerInfo
public SignerInfo(SignerIdentifier sid, AlgorithmIdentifier digAlgorithm, ASN1Set authenticatedAttributes, AlgorithmIdentifier digEncryptionAlgorithm, ASN1OctetString encryptedDigest, ASN1Set unauthenticatedAttributes)
- Parameters:
sid-digAlgorithm- CMS knows as 'digestAlgorithm'authenticatedAttributes- CMS knows as 'signedAttrs'digEncryptionAlgorithm- CMS knows as 'signatureAlgorithm'encryptedDigest- CMS knows as 'signature'unauthenticatedAttributes- CMS knows as 'unsignedAttrs'
-
SignerInfo
public SignerInfo(SignerIdentifier sid, AlgorithmIdentifier digAlgorithm, Attributes authenticatedAttributes, AlgorithmIdentifier digEncryptionAlgorithm, ASN1OctetString encryptedDigest, Attributes unauthenticatedAttributes)
- Parameters:
sid-digAlgorithm- CMS knows as 'digestAlgorithm'authenticatedAttributes- CMS knows as 'signedAttrs'digEncryptionAlgorithm- CMS knows as 'signatureAlgorithm'encryptedDigest- CMS knows as 'signature'unauthenticatedAttributes- CMS knows as 'unsignedAttrs'
-
SignerInfo
public SignerInfo(ASN1Sequence seq)
Deprecated.use getInstance() method.
-
-
Method Detail
-
getInstance
public static SignerInfo getInstance(java.lang.Object o) throws java.lang.IllegalArgumentException
Return a SignerInfo object from the given inputAccepted inputs:
- null → null
-
SignerInfoobject -
ASN1Sequenceinput formats with SignerInfo structure inside
- Parameters:
o- the object we want converted.- Throws:
java.lang.IllegalArgumentException- if the object cannot be converted.
-
getVersion
public ASN1Integer getVersion()
-
getSID
public SignerIdentifier getSID()
-
getAuthenticatedAttributes
public ASN1Set getAuthenticatedAttributes()
-
getDigestAlgorithm
public AlgorithmIdentifier getDigestAlgorithm()
-
getEncryptedDigest
public ASN1OctetString getEncryptedDigest()
-
getDigestEncryptionAlgorithm
public AlgorithmIdentifier getDigestEncryptionAlgorithm()
-
getUnauthenticatedAttributes
public ASN1Set getUnauthenticatedAttributes()
-
toASN1Primitive
public ASN1Primitive toASN1Primitive()
Produce an object suitable for an ASN1OutputStream.- Specified by:
toASN1Primitivein interfaceASN1Encodable- Specified by:
toASN1Primitivein classASN1Object- Returns:
- a primitive representation of this object.
-
-