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)
      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 index 0 would normally be an end-entity certificate.

      See also encodeCertificateArray(X509Certificate[]).

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

      public static CBORArray encodeCertificateArray(X509Certificate[] certificatePath)
      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 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.

      See also decodeCertificateArray(CBORArray).

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