Class CBORCryptoUtils

java.lang.Object
org.webpki.cbor.CBORCryptoUtils

public class CBORCryptoUtils extends Object
Class holding CBOR crypto support.
  • Method Details

    • decodeCertificateArray

      public static X509Certificate[] decodeCertificateArray(CBORArray array)
      Decodes 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 index 0 would normally be an end-entity certificate.

      Also see encodeCertificateArray(X509Certificate[]).

      Parameters:
      array - CBOR array with X.509 certificates
      Returns:
      Decoded X.509 certificate path
    • encodeCertificateArray

      public static CBORArray encodeCertificateArray(X509Certificate[] certificatePath)
      Encodes 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 0 would normally be an end-entity certificate. The CBOR array will after processing hold a list of DER-encoded certificates, each represented by a CBOR byte string.

      Also see decodeCertificateArray(CBORArray).

      Parameters:
      certificatePath - X.509 certificate path to be encoded
      Returns:
      CBOR array with X.509 certificates