public class ProtectedPKIMessageBuilder extends Object
Constructor and Description |
---|
ProtectedPKIMessageBuilder(GeneralName sender,
GeneralName recipient)
Commence a message with the header version CMP_2000.
|
ProtectedPKIMessageBuilder(int pvno,
GeneralName sender,
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(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(PKIBody body)
Set the body for the new message
|
ProtectedPKIMessageBuilder |
setFreeText(PKIFreeText freeText)
Include a human-readable message in the new message.
|
ProtectedPKIMessageBuilder |
setMessageTime(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(GeneralName sender, GeneralName recipient)
sender
- message sender.recipient
- intended recipient.public ProtectedPKIMessageBuilder(int pvno, GeneralName sender, 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(PKIFreeText freeText)
freeText
- the contents of the human readable message,public ProtectedPKIMessageBuilder addGeneralInfo(InfoTypeAndValue genInfo)
genInfo
- the generalInfo data to be added.public ProtectedPKIMessageBuilder setMessageTime(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(PKIBody body)
body
- the message body.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.Copyright © 2015. All rights reserved.