public class PKIMessage extends java.lang.Object implements ASN1Type
PKIMessage ::= SEQUENCE {
header PKIHeader,
body PKIBody,
protection [0] PKIProtection OPTIONAL,
extraCerts [1] SEQUENCE SIZE (1..MAX) OF Certificate OPTIONAL
}
| Constructor and Description |
|---|
PKIMessage(ASN1Object obj)
Creates a new
PKIMessage object from an ASN1Object. |
PKIMessage(PKIHeader header,
PKIBody body)
Creates a new
PKIMessage object with the specified components. |
| Modifier and Type | Method and Description |
|---|---|
void |
addExtraCert(X509Certificate extraCert)
Adds the specified certificate to the extraCerts component.
|
void |
decode(ASN1Object obj)
Decodes an PKIMessage structure from an
ASN1Object. |
PKIBody |
getBody()
Returns the message-specific information.
|
X509Certificate[] |
getExtraCerts()
Returns all the extra certificates this object contains as an array of
X509Certificate objects.
|
PKIHeader |
getHeader()
Returns the information which is common to many PKI messages.
|
byte[] |
getProtection()
Returns the message protection if it has been set; otherwise
null is returned. |
void |
setProtection(byte[] protection)
Sets the message protection bits.
|
ASN1Object |
toASN1Object()
Encodes this
PKIMessage object as an ASN1Object. |
java.lang.String |
toString()
Creates a text representation of the ASN.1 structure of this
PKIMessage object. |
public PKIMessage(PKIHeader header, PKIBody body)
PKIMessage object with the specified components.header - information which is common to many PKI messagesbody - message-specific informationpublic PKIMessage(ASN1Object obj) throws CodingException
PKIMessage object from an ASN1Object.obj - the ASN.1 representation of an PKIMessage structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic void setProtection(byte[] protection)
protection - the protection componentpublic void addExtraCert(X509Certificate extraCert)
null, it is not added.extraCert - the certificate to addpublic PKIHeader getHeader()
public PKIBody getBody()
public byte[] getProtection()
null is returned.public X509Certificate[] getExtraCerts()
public void decode(ASN1Object obj) throws CodingException
ASN1Object.decode in interface ASN1Typeobj - an ASN.1 representation of a PKIMessage structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic ASN1Object toASN1Object()
PKIMessage object as an ASN1Object.toASN1Object in interface ASN1Typepublic java.lang.String toString()
PKIMessage object.toString in class java.lang.Object