public class C509CertificationRequest
extends java.lang.Object
C509CertificationRequest = [ TBSCertificationRequest, subjectSignatureValue: any ]where the six elements of the TBSCertificationRequest group are inlined into the array. As with certificates, type 2 is natively signed (the signature covers the TBSCertificationRequest CBOR sequence) and type 3 is an invertible re-encoding of a DER RFC 2986 certification request whose signature is copied and remains verifiable over the reconstructed DER.
| Modifier and Type | Field and Description |
|---|---|
static int |
TYPE_NATIVE
Natively signed C509 certification request (c509CertificationRequestType = 2).
|
static int |
TYPE_REENCODED_PKCS10
CBOR re-encoding of an RFC 2986 certification request (c509CertificationRequestType = 3).
|
| Modifier and Type | Method and Description |
|---|---|
static C509CertificationRequest |
create(byte[] tbsCertificationRequest,
byte[] signature)
Assemble a certification request from an encoded TBSCertificationRequest (see
createTBSCertificationRequest(int, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.asn1.x500.X500Name, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo, org.bouncycastle.asn1.x509.Extensions, java.lang.String, org.bouncycastle.cbor.c509.C509ConversionOptions)) and the newly created signature over it. |
static C509CertificationRequest |
create(byte[] tbsCertificationRequest,
byte[] signature,
C509ConversionOptions options)
Assemble a certification request from an encoded TBSCertificationRequest and
the newly created signature over it, with the options controlling the ECDSA
signature component width.
|
static byte[] |
createTBSCertificationRequest(int requestType,
org.bouncycastle.asn1.x509.AlgorithmIdentifier subjectSignatureAlgorithm,
org.bouncycastle.asn1.x500.X500Name subject,
org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo,
org.bouncycastle.asn1.x509.Extensions extensionRequest,
java.lang.String challengePassword,
C509ConversionOptions options)
Encode the TBSCertificationRequest group for a request about to be signed.
|
static byte[] |
createTBSCertificationRequest(int requestType,
org.bouncycastle.asn1.x509.AlgorithmIdentifier subjectSignatureAlgorithm,
org.bouncycastle.asn1.x500.X500Name subject,
org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo,
org.bouncycastle.asn1.x509.Extensions extensionRequest,
java.lang.String challengePassword,
C509PrivateKeyPossessionStatement possessionStatement,
C509ConversionOptions options)
Encode the TBSCertificationRequest group for a request about to be signed,
optionally carrying an RFC 9883 private key possession statement.
|
static C509CertificationRequest |
fromCertificationRequest(byte[] derEncoding)
Convert a DER-encoded RFC 2986 certification request to a CBOR re-encoded C509
certification request (type 3) using the default conversion options.
|
static C509CertificationRequest |
fromCertificationRequest(org.bouncycastle.asn1.pkcs.CertificationRequest request,
C509ConversionOptions options)
Convert a DER-encoded RFC 2986 certification request to a CBOR re-encoded C509
certification request (type 3).
|
C509Attribute[] |
getAttributes()
Return the request attributes.
|
byte[] |
getEncoded()
Return the complete CBOR encoding of this certification request.
|
static C509CertificationRequest |
getInstance(byte[] encoding)
Parse a C509 certification request from its CBOR encoding.
|
int |
getRequestType()
Return the request type (
TYPE_NATIVE or TYPE_REENCODED_PKCS10). |
byte[] |
getSignature()
Return the signature value in its X.509 form: for an ECDSA style algorithm the
DER SEQUENCE of the two INTEGERs, for an RFC 6955 proof-of-possession algorithm
the DER DhSigStatic, otherwise the BIT STRING value field unchanged.
|
org.bouncycastle.asn1.x500.X500Name |
getSubject()
Return the subject name.
|
C509AlgorithmIdentifier |
getSubjectPublicKeyAlgorithm()
Return the subject public key algorithm.
|
org.bouncycastle.asn1.x509.SubjectPublicKeyInfo |
getSubjectPublicKeyInfo()
Return the subject public key.
|
C509AlgorithmIdentifier |
getSubjectSignatureAlgorithm()
Return the subject signature algorithm.
|
byte[] |
getTBSCertificationRequestEncoded()
Return the encoding of the TBSCertificationRequest group as a CBOR sequence -
for a natively signed request, the exact bytes the signature covers.
|
org.bouncycastle.asn1.pkcs.CertificationRequest |
toCertificationRequest()
Reconstruct the RFC 2986 certification request a CBOR re-encoded C509
certification request stands for.
|
public static final int TYPE_NATIVE
public static final int TYPE_REENCODED_PKCS10
public static C509CertificationRequest getInstance(byte[] encoding) throws java.io.IOException
java.io.IOExceptionpublic static C509CertificationRequest create(byte[] tbsCertificationRequest, byte[] signature) throws java.io.IOException
createTBSCertificationRequest(int, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.asn1.x500.X500Name, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo, org.bouncycastle.asn1.x509.Extensions, java.lang.String, org.bouncycastle.cbor.c509.C509ConversionOptions)) and the newly created signature over it.java.io.IOExceptionpublic static C509CertificationRequest create(byte[] tbsCertificationRequest, byte[] signature, C509ConversionOptions options) throws java.io.IOException
java.io.IOExceptionpublic static byte[] createTBSCertificationRequest(int requestType,
org.bouncycastle.asn1.x509.AlgorithmIdentifier subjectSignatureAlgorithm,
org.bouncycastle.asn1.x500.X500Name subject,
org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo,
org.bouncycastle.asn1.x509.Extensions extensionRequest,
java.lang.String challengePassword,
C509ConversionOptions options)
throws java.io.IOException
requestType - TYPE_NATIVE or TYPE_REENCODED_PKCS10.subjectSignatureAlgorithm - the X.509 signature (or RFC 6955
proof-of-possession) algorithm.subject - the subject name.subjectPublicKeyInfo - the subject public key.extensionRequest - extensions requested of the CA (RFC 2985
extensionRequest), or null for none.challengePassword - a challenge password (RFC 2985), or null for none.java.io.IOExceptionpublic static byte[] createTBSCertificationRequest(int requestType,
org.bouncycastle.asn1.x509.AlgorithmIdentifier subjectSignatureAlgorithm,
org.bouncycastle.asn1.x500.X500Name subject,
org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo,
org.bouncycastle.asn1.x509.Extensions extensionRequest,
java.lang.String challengePassword,
C509PrivateKeyPossessionStatement possessionStatement,
C509ConversionOptions options)
throws java.io.IOException
requestType - TYPE_NATIVE or TYPE_REENCODED_PKCS10.subjectSignatureAlgorithm - the X.509 signature (or RFC 6955
proof-of-possession) algorithm.subject - the subject name.subjectPublicKeyInfo - the subject public key.extensionRequest - extensions requested of the CA (RFC 2985
extensionRequest), or null for none.challengePassword - a challenge password (RFC 2985), or null for none.possessionStatement - a private key possession statement (RFC 9883,
Section 4.3.3), or null for none.java.io.IOExceptionpublic static C509CertificationRequest fromCertificationRequest(byte[] derEncoding) throws java.io.IOException
java.io.IOExceptionpublic static C509CertificationRequest fromCertificationRequest(org.bouncycastle.asn1.pkcs.CertificationRequest request, C509ConversionOptions options) throws java.io.IOException
java.io.IOExceptionpublic org.bouncycastle.asn1.pkcs.CertificationRequest toCertificationRequest()
throws java.io.IOException
java.lang.IllegalStateException - if this is a natively signed request.java.io.IOException - if an attribute has no DER reconstruction - a
privateKeyPossessionStatement carrying a natively signed certificate.public byte[] getEncoded()
throws java.io.IOException
java.io.IOExceptionpublic byte[] getTBSCertificationRequestEncoded()
throws java.io.IOException
java.io.IOExceptionpublic int getRequestType()
TYPE_NATIVE or TYPE_REENCODED_PKCS10).public C509AlgorithmIdentifier getSubjectSignatureAlgorithm()
public org.bouncycastle.asn1.x500.X500Name getSubject()
public C509AlgorithmIdentifier getSubjectPublicKeyAlgorithm()
public org.bouncycastle.asn1.x509.SubjectPublicKeyInfo getSubjectPublicKeyInfo()
public C509Attribute[] getAttributes()
public byte[] getSignature()