public class SignedData extends ASN1Object
A signed data object containing multitude of SignerInfo
s.
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 3852 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
Modifier and Type | Field and Description |
---|---|
private ASN1Set |
certificates |
private boolean |
certsBer |
private ContentInfo |
contentInfo |
private ASN1Set |
crls |
private boolean |
crlsBer |
private ASN1Set |
digestAlgorithms |
private ASN1Set |
signerInfos |
private ASN1Integer |
version |
private static ASN1Integer |
VERSION_1 |
private static ASN1Integer |
VERSION_3 |
private static ASN1Integer |
VERSION_4 |
private static ASN1Integer |
VERSION_5 |
Modifier | Constructor and Description |
---|---|
private |
SignedData(ASN1Sequence seq) |
|
SignedData(ASN1Set digestAlgorithms,
ContentInfo contentInfo,
ASN1Set certificates,
ASN1Set crls,
ASN1Set signerInfos) |
Modifier and Type | Method and Description |
---|---|
private ASN1Integer |
calculateVersion(ASN1ObjectIdentifier contentOid,
ASN1Set certs,
ASN1Set crls,
ASN1Set signerInfs) |
private boolean |
checkForVersion3(ASN1Set signerInfs) |
ASN1Set |
getCertificates() |
ASN1Set |
getCRLs() |
ASN1Set |
getDigestAlgorithms() |
ContentInfo |
getEncapContentInfo() |
static SignedData |
getInstance(Object o)
Return a SignedData object from the given object.
|
ASN1Set |
getSignerInfos() |
ASN1Integer |
getVersion() |
ASN1Primitive |
toASN1Primitive()
Produce an object suitable for an ASN1OutputStream.
|
equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode, toASN1Object
private static final ASN1Integer VERSION_1
private static final ASN1Integer VERSION_3
private static final ASN1Integer VERSION_4
private static final ASN1Integer VERSION_5
private ASN1Integer version
private ASN1Set digestAlgorithms
private ContentInfo contentInfo
private ASN1Set certificates
private ASN1Set signerInfos
private boolean certsBer
private boolean crlsBer
public SignedData(ASN1Set digestAlgorithms, ContentInfo contentInfo, ASN1Set certificates, ASN1Set crls, ASN1Set signerInfos)
private SignedData(ASN1Sequence seq)
public static SignedData getInstance(Object o)
Accepted inputs:
SignedData
object
ASN1Sequence
input formats with SignedData structure inside
o
- the object we want converted.IllegalArgumentException
- if the object cannot be converted.private ASN1Integer calculateVersion(ASN1ObjectIdentifier contentOid, ASN1Set certs, ASN1Set crls, ASN1Set signerInfs)
private boolean checkForVersion3(ASN1Set signerInfs)
public ASN1Integer getVersion()
public ASN1Set getDigestAlgorithms()
public ContentInfo getEncapContentInfo()
public ASN1Set getCertificates()
public ASN1Set getSignerInfos()
public ASN1Primitive toASN1Primitive()
toASN1Primitive
in interface ASN1Encodable
toASN1Primitive
in class ASN1Object