Package org.bouncycastle.cert.c509
Class C509CertificationRequestHolder
- java.lang.Object
-
- org.bouncycastle.cert.c509.C509CertificationRequestHolder
-
- All Implemented Interfaces:
org.bouncycastle.util.Encodable
public class C509CertificationRequestHolder extends java.lang.Object implements org.bouncycastle.util.EncodableHolding 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 Summary
Constructors Constructor Description C509CertificationRequestHolder(byte[] encoding)Create a holder from the CBOR encoding of a C509 certification request.C509CertificationRequestHolder(org.bouncycastle.cbor.c509.C509CertificationRequest request)Base constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.cbor.c509.C509Attribute[]getAttributes()org.bouncycastle.cbor.c509.C509CertificationRequestgetC509CertificationRequest()Return the certification request this holder wraps.byte[]getEncoded()Return the CBOR encoding of the certification request.intgetRequestType()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.X500NamegetSubject()org.bouncycastle.asn1.x509.SubjectPublicKeyInfogetSubjectPublicKeyInfo()booleanisSignatureValid(ContentVerifierProvider verifierProvider)Validate the signature (the proof-of-possession) on this certification request.
-
-
-
Constructor Detail
-
C509CertificationRequestHolder
public C509CertificationRequestHolder(org.bouncycastle.cbor.c509.C509CertificationRequest request)
Base constructor.
-
C509CertificationRequestHolder
public C509CertificationRequestHolder(byte[] encoding) throws java.io.IOExceptionCreate 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.IOExceptionReturn 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.IOExceptionReturn the CBOR encoding of the certification request.- Specified by:
getEncodedin interfaceorg.bouncycastle.util.Encodable- Throws:
java.io.IOException
-
-