PKIMessage (Bouncy Castle Library 1.54 API Specification)
Date: 2015-12-29

org.bouncycastle.asn1.cmp

## Class PKIMessage

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Object
  - - org.bouncycastle.asn1.cmp.PKIMessage

- All Implemented Interfaces:
    ASN1Encodable, Encodable

      public class PKIMessage
      extends ASN1Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PKIMessage(PKIHeader header, PKIBody body)`
    `PKIMessage(PKIHeader header, PKIBody body, DERBitString protection)`
    `PKIMessage(PKIHeader header, PKIBody body, DERBitString protection, CMPCertificate[] extraCerts)` Creates a new PKIMessage.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `PKIBody` | `getBody()`
    `CMPCertificate[]` | `getExtraCerts()`
    `PKIHeader` | `getHeader()`
    `static PKIMessage` | `getInstance(java.lang.Object o)`
    `DERBitString` | `getProtection()`
    `ASN1Primitive` | `toASN1Primitive()` PKIMessage ::= SEQUENCE { header PKIHeader, body PKIBody, protection [0] PKIProtection OPTIONAL, extraCerts [1] SEQUENCE SIZE (1..MAX) OF CMPCertificate OPTIONAL }

    - ### Methods inherited from class org.bouncycastle.asn1.ASN1Object

      `equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode, toASN1Object`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PKIMessage

          public PKIMessage(PKIHeader header,
                    PKIBody body,
                    DERBitString protection,
                    CMPCertificate[] extraCerts)

      Creates a new PKIMessage.
      Parameters:
        `header` - message header
        `body` - message body
        `protection` - message protection (may be null)
        `extraCerts` - extra certificates (may be null)

    - #### PKIMessage

          public PKIMessage(PKIHeader header,
                    PKIBody body,
                    DERBitString protection)

    - #### PKIMessage

          public PKIMessage(PKIHeader header,
                    PKIBody body)

  - ### Method Detail

    - #### getInstance

          public static PKIMessage getInstance(java.lang.Object o)

    - #### getHeader

          public PKIHeader getHeader()

    - #### getBody

          public PKIBody getBody()

    - #### getProtection

          public DERBitString getProtection()

    - #### getExtraCerts

          public CMPCertificate[] getExtraCerts()

    - #### toASN1Primitive

          public ASN1Primitive toASN1Primitive()

           PKIMessage ::= SEQUENCE {
                            header           PKIHeader,
                            body             PKIBody,
                            protection   [0] PKIProtection OPTIONAL,
                            extraCerts   [1] SEQUENCE SIZE (1..MAX) OF CMPCertificate
                                                                               OPTIONAL
           }

      Specified by:
        `toASN1Primitive` in interface `ASN1Encodable`
      Specified by:
        `toASN1Primitive` in class `ASN1Object`
      Returns:
        a basic ASN.1 object representation.