Top Description Fields Constructors Methods
org.bouncycastle.asn1.cms

public Class SignedData

extends ASN1Object
Class Inheritance
Imports
java.util.Enumeration, org.bouncycastle.asn1.ASN1EncodableVector, .ASN1Integer, .ASN1Object, .ASN1ObjectIdentifier, .ASN1Primitive, .ASN1Sequence, .ASN1Set, .ASN1TaggedObject, .BERSequence, .BERSet, .BERTaggedObject, .DERTaggedObject, .DLSequence

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

Field Summary

Modifier and TypeField and Description
private ASN1Set
private boolean
private final ContentInfo
private ASN1Set
private boolean
private final ASN1Set
private final boolean
private final ASN1Set
private final boolean
private final ASN1Integer
private static final ASN1Integer
private static final ASN1Integer
private static final ASN1Integer
private static final ASN1Integer

Constructor Summary

AccessConstructor and Description
public
SignedData(ASN1Set digestAlgorithms, ContentInfo contentInfo, ASN1Set certificates, ASN1Set crls, ASN1Set signerInfos)

private

Method Summary

Modifier and TypeMethod and Description
private ASN1Integer
calculateVersion(ASN1ObjectIdentifier contentOid, ASN1Set certs, ASN1Set crls, ASN1Set signerInfs)

private boolean
public ASN1Set
public ASN1Set
public ASN1Set
public ContentInfo
public static SignedData

Returns:

a reference that can be assigned to SignedData (may be null)
getInstance
(Object
the object we want converted.
o
)

Return a SignedData object from the given object.

public ASN1Set
public ASN1Integer
public ASN1Primitive
toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Produce an object suitable for an ASN1OutputStream.
Inherited from org.bouncycastle.asn1.ASN1Object:
encodeToencodeToequalsgetEncodedgetEncodedhasEncodedTagValuehashCode

Field Detail

certificatesback to summary
private ASN1Set certificates
certsBerback to summary
private boolean certsBer
contentInfoback to summary
private final ContentInfo contentInfo
crlsback to summary
private ASN1Set crls
crlsBerback to summary
private boolean crlsBer
digestAlgorithmsback to summary
private final ASN1Set digestAlgorithms
digsBerback to summary
private final boolean digsBer
signerInfosback to summary
private final ASN1Set signerInfos
sigsBerback to summary
private final boolean sigsBer
versionback to summary
private final ASN1Integer version
VERSION_1back to summary
private static final ASN1Integer VERSION_1
VERSION_3back to summary
private static final ASN1Integer VERSION_3
VERSION_4back to summary
private static final ASN1Integer VERSION_4
VERSION_5back to summary
private static final ASN1Integer VERSION_5

Constructor Detail

SignedDataback to summary
public SignedData(ASN1Set digestAlgorithms, ContentInfo contentInfo, ASN1Set certificates, ASN1Set crls, ASN1Set signerInfos)
SignedDataback to summary
private SignedData(ASN1Sequence seq)

Method Detail

calculateVersionback to summary
private ASN1Integer calculateVersion(ASN1ObjectIdentifier contentOid, ASN1Set certs, ASN1Set crls, ASN1Set signerInfs)
checkForVersion3back to summary
private boolean checkForVersion3(ASN1Set signerInfs)
getCertificatesback to summary
public ASN1Set getCertificates()
getCRLsback to summary
public ASN1Set getCRLs()
getDigestAlgorithmsback to summary
public ASN1Set getDigestAlgorithms()
getEncapContentInfoback to summary
public ContentInfo getEncapContentInfo()
getInstanceback to summary
public static SignedData getInstance(Object o)

Return a SignedData object from the given object.

Accepted inputs:

Parameters
o:Object

the object we want converted.

Returns:SignedData

a reference that can be assigned to SignedData (may be null)

Exceptions
IllegalArgumentException:
if the object cannot be converted.
getSignerInfosback to summary
public ASN1Set getSignerInfos()
getVersionback to summary
public ASN1Integer getVersion()
toASN1Primitiveback to summary
public ASN1Primitive toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Produce an object suitable for an ASN1OutputStream.

Returns:ASN1Primitive

Doc from org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

a primitive representation of this object.