Class COSEC509

java.lang.Object
org.bouncycastle.cbor.c509.COSEC509

public final class COSEC509 extends Object
The COSE_C509 structure (Section 3.4 of draft-ietf-cose-cbor-encoded-cert-20):
COSE_C509 = C509CertData / [ 2* C509CertData ]
C509CertData = bytes .cbor C509Certificate
a single certificate, or an array of two or more, each wrapped in a byte string so a parser can skip over individual certificates.
  • Method Details

    • encode

      public static byte[] encode(C509Certificate[] certificates) throws IOException
      Encode a bag or chain of certificates as a COSE_C509 structure. One certificate is encoded as a bare C509CertData; two or more as an array.
      Throws:
      IOException
    • decode

      public static C509Certificate[] decode(byte[] encoding) throws IOException
      Decode a COSE_C509 structure.
      Throws:
      IOException