Top Fields Constructors Methods
org.bouncycastle.asn1.cmp

public Class PKIHeaderBuilder

extends Object
Class Inheritance
Imports
org.bouncycastle.asn1.ASN1Encodable, .ASN1EncodableVector, .ASN1GeneralizedTime, .ASN1Integer, .ASN1OctetString, .ASN1Sequence, .DEROctetString, .DERSequence, .DERTaggedObject, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .GeneralName, org.bouncycastle.util.Arrays

Field Summary

Modifier and TypeField and Description
private PKIFreeText
private ASN1Sequence
private ASN1GeneralizedTime
private AlgorithmIdentifier
private final ASN1Integer
private final GeneralName
private ASN1OctetString
private ASN1OctetString
private final GeneralName
private ASN1OctetString
private ASN1OctetString
private ASN1OctetString

Constructor Summary

AccessConstructor and Description
public
PKIHeaderBuilder(int pvno, GeneralName sender, GeneralName recipient)

private

Method Summary

Modifier and TypeMethod and Description
private void
public PKIHeader

Returns:

a basic ASN.1 object representation.
build
()

 PKIHeader ::= SEQUENCE {
           pvno                INTEGER     { cmp1999(1), cmp2000(2) },
           sender              GeneralName,
           -- identifies the sender
           recipient           GeneralName,
           -- identifies the intended recipient
           messageTime     [0] GeneralizedTime         OPTIONAL,
           -- time of production of this message (used when sender
           -- believes that the transport will be "suitable"; i.e.,
           -- that the time will still be meaningful upon receipt)
           protectionAlg   [1] AlgorithmIdentifier     OPTIONAL,
           -- algorithm used for calculation of protection bits
           senderKID       [2] KeyIdentifier           OPTIONAL,
           recipKID        [3] KeyIdentifier           OPTIONAL,
           -- to identify specific keys used for protection
           transactionID   [4] OCTET STRING            OPTIONAL,
           -- identifies the transaction; i.e., this will be the same in
           -- corresponding request, response, certConf, and PKIConf
           -- messages
           senderNonce     [5] OCTET STRING            OPTIONAL,
           recipNonce      [6] OCTET STRING            OPTIONAL,
           -- nonces used to provide replay protection, senderNonce
           -- is inserted by the creator of this message; recipNonce
           -- is a nonce previously inserted in a related message by
           -- the intended recipient of this message
           freeText        [7] PKIFreeText             OPTIONAL,
           -- this may be used to indicate context-specific instructions
           -- (this field is intended for human consumption)
           generalInfo     [8] SEQUENCE SIZE (1..MAX) OF
                                InfoTypeAndValue     OPTIONAL
           -- this may be used to convey context-specific information
           -- (this field not primarily intended for human consumption)
}
private DEROctetString
private static ASN1Sequence
private static ASN1Sequence
public PKIHeaderBuilder
public PKIHeaderBuilder
public PKIHeaderBuilder
public PKIHeaderBuilder
setGeneralInfo(ASN1Sequence seqOfInfoTypeAndValue)

public PKIHeaderBuilder
public PKIHeaderBuilder
public PKIHeaderBuilder
setRecipKID(byte[] kid)

public PKIHeaderBuilder
public PKIHeaderBuilder
setRecipNonce(byte[] nonce)

public PKIHeaderBuilder
public PKIHeaderBuilder
setSenderKID(byte[] kid)

public PKIHeaderBuilder
public PKIHeaderBuilder
setSenderNonce(byte[] nonce)

public PKIHeaderBuilder
public PKIHeaderBuilder
setTransactionID(byte[] tid)

public PKIHeaderBuilder
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

freeTextback to summary
private PKIFreeText freeText
generalInfoback to summary
private ASN1Sequence generalInfo
messageTimeback to summary
private ASN1GeneralizedTime messageTime
protectionAlgback to summary
private AlgorithmIdentifier protectionAlg
pvnoback to summary
private final ASN1Integer pvno
recipientback to summary
private final GeneralName recipient
recipKIDback to summary
private ASN1OctetString recipKID
recipNonceback to summary
private ASN1OctetString recipNonce
senderback to summary
private final GeneralName sender
senderKIDback to summary
private ASN1OctetString senderKID
senderNonceback to summary
private ASN1OctetString senderNonce
transactionIDback to summary
private ASN1OctetString transactionID

Constructor Detail

PKIHeaderBuilderback to summary
public PKIHeaderBuilder(int pvno, GeneralName sender, GeneralName recipient)
PKIHeaderBuilderback to summary
private PKIHeaderBuilder(ASN1Integer pvno, GeneralName sender, GeneralName recipient)

Method Detail

addOptionalback to summary
private void addOptional(ASN1EncodableVector v, int tagNo, ASN1Encodable obj)
buildback to summary
public PKIHeader build()
 PKIHeader ::= SEQUENCE {
           pvno                INTEGER     { cmp1999(1), cmp2000(2) },
           sender              GeneralName,
           -- identifies the sender
           recipient           GeneralName,
           -- identifies the intended recipient
           messageTime     [0] GeneralizedTime         OPTIONAL,
           -- time of production of this message (used when sender
           -- believes that the transport will be "suitable"; i.e.,
           -- that the time will still be meaningful upon receipt)
           protectionAlg   [1] AlgorithmIdentifier     OPTIONAL,
           -- algorithm used for calculation of protection bits
           senderKID       [2] KeyIdentifier           OPTIONAL,
           recipKID        [3] KeyIdentifier           OPTIONAL,
           -- to identify specific keys used for protection
           transactionID   [4] OCTET STRING            OPTIONAL,
           -- identifies the transaction; i.e., this will be the same in
           -- corresponding request, response, certConf, and PKIConf
           -- messages
           senderNonce     [5] OCTET STRING            OPTIONAL,
           recipNonce      [6] OCTET STRING            OPTIONAL,
           -- nonces used to provide replay protection, senderNonce
           -- is inserted by the creator of this message; recipNonce
           -- is a nonce previously inserted in a related message by
           -- the intended recipient of this message
           freeText        [7] PKIFreeText             OPTIONAL,
           -- this may be used to indicate context-specific instructions
           -- (this field is intended for human consumption)
           generalInfo     [8] SEQUENCE SIZE (1..MAX) OF
                                InfoTypeAndValue     OPTIONAL
           -- this may be used to convey context-specific information
           -- (this field not primarily intended for human consumption)
}
Returns:PKIHeader

a basic ASN.1 object representation.

createClonedOctetStringback to summary
private DEROctetString createClonedOctetString(byte[] value)
makeGeneralInfoSeqback to summary
private static ASN1Sequence makeGeneralInfoSeq(InfoTypeAndValue generalInfo)
makeGeneralInfoSeqback to summary
private static ASN1Sequence makeGeneralInfoSeq(InfoTypeAndValue[] generalInfos)
setFreeTextback to summary
public PKIHeaderBuilder setFreeText(PKIFreeText text)
setGeneralInfoback to summary
public PKIHeaderBuilder setGeneralInfo(InfoTypeAndValue genInfo)
setGeneralInfoback to summary
public PKIHeaderBuilder setGeneralInfo(InfoTypeAndValue[] genInfos)
setGeneralInfoback to summary
public PKIHeaderBuilder setGeneralInfo(ASN1Sequence seqOfInfoTypeAndValue)
setMessageTimeback to summary
public PKIHeaderBuilder setMessageTime(ASN1GeneralizedTime time)
setProtectionAlgback to summary
public PKIHeaderBuilder setProtectionAlg(AlgorithmIdentifier aid)
setRecipKIDback to summary
public PKIHeaderBuilder setRecipKID(byte[] kid)
setRecipKIDback to summary
public PKIHeaderBuilder setRecipKID(ASN1OctetString kid)
setRecipNonceback to summary
public PKIHeaderBuilder setRecipNonce(byte[] nonce)
setRecipNonceback to summary
public PKIHeaderBuilder setRecipNonce(ASN1OctetString nonce)
setSenderKIDback to summary
public PKIHeaderBuilder setSenderKID(byte[] kid)
setSenderKIDback to summary
public PKIHeaderBuilder setSenderKID(ASN1OctetString kid)
setSenderNonceback to summary
public PKIHeaderBuilder setSenderNonce(byte[] nonce)
setSenderNonceback to summary
public PKIHeaderBuilder setSenderNonce(ASN1OctetString nonce)
setTransactionIDback to summary
public PKIHeaderBuilder setTransactionID(byte[] tid)
setTransactionIDback to summary
public PKIHeaderBuilder setTransactionID(ASN1OctetString tid)