Package org.bouncycastle.asn1.cms
Class SignedData
java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.cms.SignedData
- All Implemented Interfaces:
org.bouncycastle.asn1.ASN1Encodable,org.bouncycastle.util.Encodable
public class SignedData
extends org.bouncycastle.asn1.ASN1Object
RFC 5652:
A signed data object containing multitude of SignerInfos.
SignedData ::= SEQUENCE {
version CMSVersion,
digestAlgorithms DigestAlgorithmIdentifiers,
encapContentInfo EncapsulatedContentInfo,
certificates [0] IMPLICIT CertificateSet OPTIONAL,
crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
signerInfos SignerInfos
}
DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier
SignerInfos ::= SET OF SignerInfo
The version calculation uses following ruleset from RFC 5652 section 5.1:
IF ((certificates is present) AND
(any certificates with a type of other are present)) OR
((crls is present) AND
(any crls with a type of other are present))
THEN version MUST be 5
ELSE
IF (certificates is present) AND
(any version 2 attribute certificates are present)
THEN version MUST be 4
ELSE
IF ((certificates is present) AND
(any version 1 attribute certificates are present)) OR
(any SignerInfo structures are version 3) OR
(encapContentInfo eContentType is other than id-data)
THEN version MUST be 3
ELSE version MUST be 1
-
Constructor Summary
ConstructorsConstructorDescriptionSignedData(org.bouncycastle.asn1.ASN1Set digestAlgorithms, ContentInfo contentInfo, org.bouncycastle.asn1.ASN1Set certificates, org.bouncycastle.asn1.ASN1Set crls, org.bouncycastle.asn1.ASN1Set signerInfos) -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.asn1.ASN1Setorg.bouncycastle.asn1.ASN1SetgetCRLs()org.bouncycastle.asn1.ASN1Setstatic SignedDataReturn a SignedData object from the given object.org.bouncycastle.asn1.ASN1Setorg.bouncycastle.asn1.ASN1Integerorg.bouncycastle.asn1.ASN1PrimitiveProduce an object suitable for an ASN1OutputStream.Methods inherited from class org.bouncycastle.asn1.ASN1Object
encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode
-
Constructor Details
-
SignedData
public SignedData(org.bouncycastle.asn1.ASN1Set digestAlgorithms, ContentInfo contentInfo, org.bouncycastle.asn1.ASN1Set certificates, org.bouncycastle.asn1.ASN1Set crls, org.bouncycastle.asn1.ASN1Set signerInfos)
-
-
Method Details
-
getInstance
Return a SignedData object from the given object.Accepted inputs:
- null → null
-
SignedDataobject -
ASN1Sequenceinput formats with SignedData structure inside
- Parameters:
o- the object we want converted.- Returns:
- a reference that can be assigned to SignedData (may be null)
- Throws:
IllegalArgumentException- if the object cannot be converted.
-
getVersion
public org.bouncycastle.asn1.ASN1Integer getVersion() -
getDigestAlgorithms
public org.bouncycastle.asn1.ASN1Set getDigestAlgorithms() -
getEncapContentInfo
-
getCertificates
public org.bouncycastle.asn1.ASN1Set getCertificates() -
getCRLs
public org.bouncycastle.asn1.ASN1Set getCRLs() -
getSignerInfos
public org.bouncycastle.asn1.ASN1Set getSignerInfos() -
toASN1Primitive
public org.bouncycastle.asn1.ASN1Primitive toASN1Primitive()Produce an object suitable for an ASN1OutputStream.- Specified by:
toASN1Primitivein interfaceorg.bouncycastle.asn1.ASN1Encodable- Specified by:
toASN1Primitivein classorg.bouncycastle.asn1.ASN1Object
-