Class C509PEM
java.lang.Object
org.bouncycastle.cbor.c509.C509PEM
- All Implemented Interfaces:
Destroyable
A C509PEM structure (Section 3.6 of draft-ietf-cose-cbor-encoded-cert-20):
C509PEM = [ C509PrivateKey, COSE_C509 / null ]pairing a private key with the certificates for the corresponding public key. Destroying a C509PEM destroys the private key it holds.
-
Constructor Summary
ConstructorsConstructorDescriptionC509PEM(C509PrivateKey privateKey, C509Certificate[] certificates) Base constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Return the certificates, or null if none were carried.byte[]Return the complete CBOR encoding of this structure.static C509PEMgetInstance(byte[] encoding) Parse a C509PEM structure from its CBOR encoding.Return the private key.boolean
-
Constructor Details
-
C509PEM
Base constructor.- Parameters:
privateKey- the private key.certificates- the certificates for the corresponding public key, or null.
-
-
Method Details
-
getInstance
Parse a C509PEM structure from its CBOR encoding.- Throws:
IOException
-
getEncoded
Return the complete CBOR encoding of this structure.- Throws:
IOException
-
getPrivateKey
Return the private key. -
getCertificates
Return the certificates, or null if none were carried. -
destroy
- Specified by:
destroyin interfaceDestroyable- Throws:
DestroyFailedException
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyedin interfaceDestroyable
-