public class ProtectedPKIMessageBuilder
extends java.lang.Object
| Constructor and Description |
|---|
ProtectedPKIMessageBuilder(org.bouncycastle.asn1.x509.GeneralName sender,
org.bouncycastle.asn1.x509.GeneralName recipient)
Commence a message with the header version CMP_2000.
|
ProtectedPKIMessageBuilder(int pvno,
org.bouncycastle.asn1.x509.GeneralName sender,
org.bouncycastle.asn1.x509.GeneralName recipient)
Commence a message with a specific header type.
|
| Modifier and Type | Method and Description |
|---|---|
ProtectedPKIMessageBuilder |
addCMPCertificate(X509CertificateHolder extraCert)
Add an "extra certificate" to the message.
|
ProtectedPKIMessageBuilder |
addGeneralInfo(org.bouncycastle.asn1.cmp.InfoTypeAndValue genInfo)
Add a generalInfo data record to the header of the new message.
|
ProtectedPKIMessage |
build(ContentSigner signer)
Build a protected PKI message which has MAC based integrity protection.
|
ProtectedPKIMessage |
build(MacCalculator macCalculator)
Build a protected PKI message which has MAC based integrity protection.
|
ProtectedPKIMessageBuilder |
setBody(int bodyType,
CertificateConfirmationContent certificateConfirmationContent) |
ProtectedPKIMessageBuilder |
setBody(int bodyType,
CertificateRepMessage certificateRepMessage) |
ProtectedPKIMessageBuilder |
setBody(int bodyType,
CertificateReqMessages certificateReqMessages) |
ProtectedPKIMessageBuilder |
setBody(org.bouncycastle.asn1.cmp.PKIBody body)
Set the body for the new message
|
ProtectedPKIMessageBuilder |
setBody(POPODecryptionKeyChallengeContent popoDecKeyChallContent) |
ProtectedPKIMessageBuilder |
setBody(POPODecryptionKeyResponseContent popoDecKeyRespContent) |
ProtectedPKIMessageBuilder |
setFreeText(org.bouncycastle.asn1.cmp.PKIFreeText freeText)
Include a human-readable message in the new message.
|
ProtectedPKIMessageBuilder |
setMessageTime(java.util.Date time)
Set the creation time for the new message.
|
ProtectedPKIMessageBuilder |
setRecipKID(byte[] kid)
Set the recipient key identifier for the key to be used to verify the new message.
|
ProtectedPKIMessageBuilder |
setRecipNonce(byte[] nonce)
Set the recipient nonce field on the new message.
|
ProtectedPKIMessageBuilder |
setSenderKID(byte[] kid)
Set the sender key identifier for the key used to protect the new message.
|
ProtectedPKIMessageBuilder |
setSenderNonce(byte[] nonce)
Set the sender nonce field on the new message.
|
ProtectedPKIMessageBuilder |
setTransactionID(byte[] tid)
Set the identifier for the transaction the new message will belong to.
|
public ProtectedPKIMessageBuilder(org.bouncycastle.asn1.x509.GeneralName sender,
org.bouncycastle.asn1.x509.GeneralName recipient)
sender - message sender.recipient - intended recipient.public ProtectedPKIMessageBuilder(int pvno,
org.bouncycastle.asn1.x509.GeneralName sender,
org.bouncycastle.asn1.x509.GeneralName recipient)
pvno - the version CMP_1999 or CMP_2000.sender - message sender.recipient - intended recipient.public ProtectedPKIMessageBuilder setTransactionID(byte[] tid)
tid - the transaction ID.public ProtectedPKIMessageBuilder setFreeText(org.bouncycastle.asn1.cmp.PKIFreeText freeText)
freeText - the contents of the human readable message,public ProtectedPKIMessageBuilder addGeneralInfo(org.bouncycastle.asn1.cmp.InfoTypeAndValue genInfo)
genInfo - the generalInfo data to be added.public ProtectedPKIMessageBuilder setMessageTime(java.util.Date time)
time - the message creation time.public ProtectedPKIMessageBuilder setRecipKID(byte[] kid)
kid - a key identifier.public ProtectedPKIMessageBuilder setRecipNonce(byte[] nonce)
nonce - a NONCE, typically copied from the sender nonce of the previous message.public ProtectedPKIMessageBuilder setSenderKID(byte[] kid)
kid - a key identifier.public ProtectedPKIMessageBuilder setSenderNonce(byte[] nonce)
nonce - a NONCE, typically 128 bits of random data.public ProtectedPKIMessageBuilder setBody(org.bouncycastle.asn1.cmp.PKIBody body)
body - the message body.public ProtectedPKIMessageBuilder setBody(int bodyType, CertificateReqMessages certificateReqMessages)
public ProtectedPKIMessageBuilder setBody(int bodyType, CertificateRepMessage certificateRepMessage)
public ProtectedPKIMessageBuilder setBody(int bodyType, CertificateConfirmationContent certificateConfirmationContent)
public ProtectedPKIMessageBuilder setBody(POPODecryptionKeyChallengeContent popoDecKeyChallContent)
public ProtectedPKIMessageBuilder setBody(POPODecryptionKeyResponseContent popoDecKeyRespContent)
public ProtectedPKIMessageBuilder addCMPCertificate(X509CertificateHolder extraCert)
extraCert - the extra certificate to add.public ProtectedPKIMessage build(MacCalculator macCalculator) throws CMPException
macCalculator - MAC calculator.CMPException - if the protection MAC cannot be calculated.public ProtectedPKIMessage build(ContentSigner signer) throws CMPException
signer - the ContentSigner to be used to calculate the signature.CMPException - if the protection signature cannot be calculated.