Class C509CertificationRequestHolder

  • All Implemented Interfaces:
    org.bouncycastle.util.Encodable

    public class C509CertificationRequestHolder
    extends java.lang.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.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.bouncycastle.cbor.c509.C509Attribute[] getAttributes()  
      org.bouncycastle.cbor.c509.C509CertificationRequest getC509CertificationRequest()
      Return the certification request this holder wraps.
      byte[] getEncoded()
      Return the CBOR encoding of the certification request.
      int getRequestType()  
      byte[] getSignedBytes()
      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.
      org.bouncycastle.asn1.x500.X500Name getSubject()  
      org.bouncycastle.asn1.x509.SubjectPublicKeyInfo getSubjectPublicKeyInfo()  
      boolean isSignatureValid​(ContentVerifierProvider verifierProvider)
      Validate the signature (the proof-of-possession) on this certification request.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • C509CertificationRequestHolder

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

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

      • 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 java.io.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:
        java.io.IOException
      • getEncoded

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