Package org.webpki.cbor
Class CBORCryptoUtils
java.lang.Object
org.webpki.cbor.CBORCryptoUtils
Class holding CBOR crypto support.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface for collecting specific data.static interfaceInterface for customizing CSF/CEF objects.static enumPolicy regarding additional CSF and CEF features. -
Method Summary
Modifier and TypeMethodDescriptionstatic X509Certificate[]decodeCertificateArray(CBORArray array) Decode a certificate path from a CBOR array.static CBORArrayencodeCertificateArray(X509Certificate[] certificatePath) Encode certificate path into a CBOR array.static byte[]getThumbPrint(PublicKey publicKey) Get COSE SHA-256 thumbprint of a public key in JCE format.
-
Method Details
-
decodeCertificateArray
Decode a certificate path from a CBOR array.The CBOR array is assumed to hold one or more X.509 certificates in DER format, each encoded as a CBOR
byte string. Note that the certificates must be featured in ascending order with respect to parenthood. That is, the certificate at index0would normally be an end-entity certificate.- Parameters:
array- CBOR array with X.509 certificates- Returns:
- Decoded X.509 certificate path
-
encodeCertificateArray
Encode certificate path into a CBOR array.Note that the certificates must be featured in ascending order with respect to parenthood. That is, the certificate at index
0would normally be an end-entity certificate. The CBOR array will after processing hold a list of DER-encoded certificates, each represented by a CBORbyte string.See also
decodeCertificateArray(CBORArray).- Parameters:
certificatePath- X.509 certificate path to be encoded- Returns:
- CBOR array with X.509 certificates
-
getThumbPrint
Get COSE SHA-256 thumbprint of a public key in JCE format.https://www.rfc-editor.org/rfc/rfc9679.html
- Parameters:
publicKey- The public key.- Returns:
- A 32-bit thumbprint.
-