public class

CertificateRequestMessage

extends Object
java.lang.Object
   ↳ org.bouncycastle.cert.crmf.CertificateRequestMessage
Known Direct Subclasses

Class Overview

Carrier for a CRMF CertReqMsg.

Summary

Constants
int popKeyAgreement
int popKeyEncipherment
int popRaVerified
int popSigningKey
Public Constructors
CertificateRequestMessage(byte[] certReqMsg)
Create a CertificateRequestMessage from the passed in bytes.
CertificateRequestMessage(CertReqMsg certReqMsg)
Public Methods
CertTemplate getCertTemplate()
Return the certificate template contained in this message.
Control getControl(ASN1ObjectIdentifier type)
Return a control value of the specified type.
byte[] getEncoded()
Return the ASN.1 encoding of the certReqMsg we wrap.
int getProofOfPossessionType()
Return the type of the proof-of-possession this request message provides.
boolean hasControl(ASN1ObjectIdentifier type)
Return whether or not this request has a specific type of control value.
boolean hasControls()
Return whether or not this request has control values associated with it.
boolean hasProofOfPossession()
Return whether or not this request message has a proof-of-possession field in it.
boolean hasSigningKeyProofOfPossessionWithPKMAC()
Return whether or not the proof-of-possession (POP) is of the type popSigningKey and it has a public key MAC associated with it.
boolean isValidSigningKeyPOP(ContentVerifierProvider verifierProvider)
Return whether or not a signing key proof-of-possession (POP) is valid.
boolean isValidSigningKeyPOP(ContentVerifierProvider verifierProvider, PKMACBuilder macBuilder, char[] password)
Return whether or not a signing key proof-of-possession (POP), with an associated PKMAC, is valid.
CertReqMsg toASN1Structure()
Return the underlying ASN.1 object defining this CertificateRequestMessage object.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int popKeyAgreement

Constant Value: 3 (0x00000003)

public static final int popKeyEncipherment

Constant Value: 2 (0x00000002)

public static final int popRaVerified

Constant Value: 0 (0x00000000)

public static final int popSigningKey

Constant Value: 1 (0x00000001)

Public Constructors

public CertificateRequestMessage (byte[] certReqMsg)

Create a CertificateRequestMessage from the passed in bytes.

Parameters
certReqMsg BER/DER encoding of the CertReqMsg structure.
Throws
IOException in the event of corrupted data, or an incorrect structure.

public CertificateRequestMessage (CertReqMsg certReqMsg)

Public Methods

public CertTemplate getCertTemplate ()

Return the certificate template contained in this message.

Returns
  • a CertTemplate structure.

public Control getControl (ASN1ObjectIdentifier type)

Return a control value of the specified type.

Parameters
type the type OID for the control value we are checking for.
Returns
  • the control value if present, null otherwise.

public byte[] getEncoded ()

Return the ASN.1 encoding of the certReqMsg we wrap.

Returns
  • a byte array containing the binary encoding of the certReqMsg.
Throws
IOException if there is an exception creating the encoding.

public int getProofOfPossessionType ()

Return the type of the proof-of-possession this request message provides.

Returns
  • one of: popRaVerified, popSigningKey, popKeyEncipherment, popKeyAgreement

public boolean hasControl (ASN1ObjectIdentifier type)

Return whether or not this request has a specific type of control value.

Parameters
type the type OID for the control value we are checking for.
Returns
  • true if a control value of type is present, false otherwise.

public boolean hasControls ()

Return whether or not this request has control values associated with it.

Returns
  • true if there are control values present, false otherwise.

public boolean hasProofOfPossession ()

Return whether or not this request message has a proof-of-possession field in it.

Returns
  • true if proof-of-possession is present, false otherwise.

public boolean hasSigningKeyProofOfPossessionWithPKMAC ()

Return whether or not the proof-of-possession (POP) is of the type popSigningKey and it has a public key MAC associated with it.

Returns
  • true if POP is popSigningKey and a PKMAC is present, false otherwise.

public boolean isValidSigningKeyPOP (ContentVerifierProvider verifierProvider)

Return whether or not a signing key proof-of-possession (POP) is valid.

Parameters
verifierProvider a provider that can produce content verifiers for the signature contained in this POP.
Returns
  • true if the POP is valid, false otherwise.
Throws
CRMFException if there is a problem in verification or content verifier creation.
IllegalStateException if POP not appropriate.

public boolean isValidSigningKeyPOP (ContentVerifierProvider verifierProvider, PKMACBuilder macBuilder, char[] password)

Return whether or not a signing key proof-of-possession (POP), with an associated PKMAC, is valid.

Parameters
verifierProvider a provider that can produce content verifiers for the signature contained in this POP.
macBuilder a suitable PKMACBuilder to create the MAC verifier.
password the password used to key the MAC calculation.
Returns
  • true if the POP is valid, false otherwise.
Throws
CRMFException if there is a problem in verification or content verifier creation.
IllegalStateException if POP not appropriate.

public CertReqMsg toASN1Structure ()

Return the underlying ASN.1 object defining this CertificateRequestMessage object.

Returns
  • a CertReqMsg.