Class C509CertificationRequestHolder

java.lang.Object
org.bouncycastle.cert.c509.C509CertificationRequestHolder
All Implemented Interfaces:
org.bouncycastle.util.Encodable

public class C509CertificationRequestHolder extends Object implements org.bouncycastle.util.Encodable
Holding class for a C509 certification request (Section 4 of draft-ietf-cose-cbor-encoded-cert-20), mirroring the PKCS#10 holding class.

For a natively signed request (type 2) the signature covers the TBSCertificationRequest CBOR sequence; for a re-encoded RFC 2986 request (type 3) it covers the reconstructed DER CertificationRequestInfo.

  • Constructor Details

    • C509CertificationRequestHolder

      public C509CertificationRequestHolder(org.bouncycastle.cbor.c509.C509CertificationRequest request)
      Base constructor.
    • C509CertificationRequestHolder

      public C509CertificationRequestHolder(byte[] encoding) throws IOException
      Create a holder from the CBOR encoding of a C509 certification request.
      Throws:
      IOException
  • Method Details

    • getC509CertificationRequest

      public org.bouncycastle.cbor.c509.C509CertificationRequest getC509CertificationRequest()
      Return the certification request this holder wraps.
    • getRequestType

      public int getRequestType()
    • getSubject

      public org.bouncycastle.asn1.x500.X500Name getSubject()
    • getSubjectPublicKeyInfo

      public org.bouncycastle.asn1.x509.SubjectPublicKeyInfo getSubjectPublicKeyInfo()
    • getAttributes

      public org.bouncycastle.cbor.c509.C509Attribute[] getAttributes()
    • isSignatureValid

      public boolean isSignatureValid(ContentVerifierProvider verifierProvider) throws CertException
      Validate the signature (the proof-of-possession) on this certification request.
      Parameters:
      verifierProvider - a provider of verifiers built on the request's subject public key.
      Returns:
      true if the signature verifies, false otherwise.
      Throws:
      CertException
    • getSignedBytes

      public byte[] getSignedBytes() throws IOException
      Return the bytes the request signature is computed over: the TBSCertificationRequest CBOR sequence for a natively signed request, the reconstructed DER CertificationRequestInfo for a re-encoded one.
      Throws:
      IOException
    • getEncoded

      public byte[] getEncoded() throws IOException
      Return the CBOR encoding of the certification request.
      Specified by:
      getEncoded in interface org.bouncycastle.util.Encodable
      Throws:
      IOException