Package org.bouncycastle.cmc
Class SimplePKIResponse
java.lang.Object
org.bouncycastle.cmc.SimplePKIResponse
- All Implemented Interfaces:
org.bouncycastle.util.Encodable
Carrier for a Simple PKI Response.
A Simple PKI Response is defined in RFC 5272 as a CMS SignedData object with no EncapsulatedContentInfo
and no SignerInfos attached. As a convenience this class also recognises the unsigned Full PKI Response
variant used for EST server-generated errors (RFC 7030 4.2.3 / 4.4.2): a CMS SignedData with no
SignerInfos whose encapsulated content is an id-cct-PKIResponse PKIResponse SEQUENCE. The structured
accessors getPKIResponse(), getControlAttributes(), getCmsContents() and
getStatusInfoV2() return the embedded PKIResponse content when present.
-
Constructor Summary
ConstructorsConstructorDescriptionSimplePKIResponse(byte[] responseEncoding) Create a SimplePKIResponse from the passed in bytes.SimplePKIResponse(org.bouncycastle.asn1.cms.ContentInfo signedData) Create a SimplePKIResponse from the passed in ASN.1 structure. -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.util.Store<X509CertificateHolder> Return any X.509 certificate objects in this SimplePKIResponse structure as a Store of X509CertificateHolder objects.org.bouncycastle.asn1.cmc.TaggedContentInfo[]Return the cmsSequence of the embedded PKIResponse as an array of TaggedContentInfo, or an empty array if no PKIResponse is present.org.bouncycastle.asn1.cmc.TaggedAttribute[]Return the controlSequence of the embedded PKIResponse as an array of TaggedAttribute, or an empty array if no PKIResponse is present.org.bouncycastle.util.Store<X509CRLHolder> getCRLs()Return any X.509 CRL objects in this SimplePKIResponse structure as a Store of X509CRLHolder objects.byte[]return the ASN.1 encoded representation of this object.org.bouncycastle.asn1.cmc.PKIResponseReturn the embedded PKIResponse content, if present.org.bouncycastle.asn1.cmc.CMCStatusInfoV2Convenience accessor for the first id-cmc-statusInfoV2 attribute in the PKIResponse controlSequence (typical of an EST server-generated error response).
-
Constructor Details
-
SimplePKIResponse
Create a SimplePKIResponse from the passed in bytes.- Parameters:
responseEncoding- BER/DER encoding of the certificate.- Throws:
CMCException- in the event of corrupted data, or an incorrect structure.
-
SimplePKIResponse
Create a SimplePKIResponse from the passed in ASN.1 structure.- Parameters:
signedData- a ContentInfo containing a SignedData.- Throws:
CMCException
-
-
Method Details
-
getCertificates
Return any X.509 certificate objects in this SimplePKIResponse structure as a Store of X509CertificateHolder objects.- Returns:
- a Store of X509CertificateHolder objects.
-
getCRLs
Return any X.509 CRL objects in this SimplePKIResponse structure as a Store of X509CRLHolder objects.- Returns:
- a Store of X509CRLHolder objects.
-
getPKIResponse
public org.bouncycastle.asn1.cmc.PKIResponse getPKIResponse()Return the embedded PKIResponse content, if present.- Returns:
- the parsed PKIResponse, or null if the SignedData has no encapsulated PKIResponse.
-
getControlAttributes
public org.bouncycastle.asn1.cmc.TaggedAttribute[] getControlAttributes()Return the controlSequence of the embedded PKIResponse as an array of TaggedAttribute, or an empty array if no PKIResponse is present. -
getCmsContents
public org.bouncycastle.asn1.cmc.TaggedContentInfo[] getCmsContents()Return the cmsSequence of the embedded PKIResponse as an array of TaggedContentInfo, or an empty array if no PKIResponse is present. -
getStatusInfoV2
public org.bouncycastle.asn1.cmc.CMCStatusInfoV2 getStatusInfoV2()Convenience accessor for the first id-cmc-statusInfoV2 attribute in the PKIResponse controlSequence (typical of an EST server-generated error response).- Returns:
- the CMCStatusInfoV2 if present, otherwise null.
-
getEncoded
return the ASN.1 encoded representation of this object.- Specified by:
getEncodedin interfaceorg.bouncycastle.util.Encodable- Throws:
IOException
-