Class C509PrivateKeyPossessionStatement
java.lang.Object
org.bouncycastle.cbor.c509.C509PrivateKeyPossessionStatement
The C509 form of the RFC 9883 privateKeyPossessionStatement certification request
attribute (Section 4.3.3 of draft-ietf-cose-cbor-encoded-cert-21):
PrivateKeyPossessionStatement = [ issuer: Name, certificateSerialNumber: CertificateSerialNumber, cert: C509CertData / null, ]The issuer and serial number name the signature certificate whose holder vouches for possession of the key-establishment private key; the certificate itself may be carried alongside, as a C509 certificate of either type. In a CBOR re-encoded (type 3) request the certificate must itself be a re-encoded (type 3) C509 certificate, or the RFC 2986 request cannot be reconstructed.
-
Constructor Summary
ConstructorsConstructorDescriptionC509PrivateKeyPossessionStatement(org.bouncycastle.asn1.x500.X500Name issuer, BigInteger serialNumber) A statement naming the signature certificate without carrying it.C509PrivateKeyPossessionStatement(org.bouncycastle.asn1.x500.X500Name issuer, BigInteger serialNumber, C509Certificate certificate) A statement naming the signature certificate, optionally carrying it.C509PrivateKeyPossessionStatement(C509Certificate certificate) A statement carrying the signature certificate, named by its own issuer and serial number. -
Method Summary
Modifier and TypeMethodDescriptionfromPrivateKeyPossessionStatement(org.bouncycastle.asn1.x509.PrivateKeyPossessionStatement statement, C509ConversionOptions options) Build the C509 form of an RFC 9883 statement, re-encoding any certificate it carries as a type 3 C509 certificate.Return the signature certificate, or null if the statement only names it.byte[]Return the CBOR encoding of the attribute value.getInstance(byte[] cborEncoding) Parse a statement from the CBOR encoding of the attribute value (the array).org.bouncycastle.asn1.x500.X500NameReturn the issuer name of the signature certificate.Return the serial number of the signature certificate.org.bouncycastle.asn1.x509.PrivateKeyPossessionStatementReturn the RFC 9883 form of this statement.
-
Constructor Details
-
C509PrivateKeyPossessionStatement
public C509PrivateKeyPossessionStatement(org.bouncycastle.asn1.x500.X500Name issuer, BigInteger serialNumber) A statement naming the signature certificate without carrying it. -
C509PrivateKeyPossessionStatement
A statement carrying the signature certificate, named by its own issuer and serial number. -
C509PrivateKeyPossessionStatement
public C509PrivateKeyPossessionStatement(org.bouncycastle.asn1.x500.X500Name issuer, BigInteger serialNumber, C509Certificate certificate) A statement naming the signature certificate, optionally carrying it.- Parameters:
certificate- the signature certificate, or null to omit it.
-
-
Method Details
-
getInstance
Parse a statement from the CBOR encoding of the attribute value (the array).- Throws:
IOException
-
fromPrivateKeyPossessionStatement
public static C509PrivateKeyPossessionStatement fromPrivateKeyPossessionStatement(org.bouncycastle.asn1.x509.PrivateKeyPossessionStatement statement, C509ConversionOptions options) throws IOException Build the C509 form of an RFC 9883 statement, re-encoding any certificate it carries as a type 3 C509 certificate.- Throws:
IOException- if the issuer name or the certificate cannot be represented in C509.
-
toPrivateKeyPossessionStatement
public org.bouncycastle.asn1.x509.PrivateKeyPossessionStatement toPrivateKeyPossessionStatement() throws IOExceptionReturn the RFC 9883 form of this statement.- Throws:
IOException- if the certificate carried is natively signed (type 2) and so has no X.509 form.
-
getIssuer
public org.bouncycastle.asn1.x500.X500Name getIssuer()Return the issuer name of the signature certificate. -
getSerialNumber
Return the serial number of the signature certificate. -
getCertificate
Return the signature certificate, or null if the statement only names it. -
getEncoded
Return the CBOR encoding of the attribute value.- Throws:
IOException
-