Class COSEEncrypt0


public class COSEEncrypt0 extends COSEMessage
COSE_Encrypt0

COSE_Encrypt0 is defined in 5.2. Single Recipient Encrypted of RFC 9052 as follows.

 COSE_Encrypt0 = [
     Headers,
     ciphertext : bstr / nil,
 ]
 
Since:
1.1
See Also:
  • Constructor Details

    • COSEEncrypt0

      public COSEEncrypt0(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem ciphertext)
      A constructor with a protected header, an unprotected header and a cipher text.
      Parameters:
      protectedHeader - A protected header. Must not be null.
      unprotectedHeader - An unprotected header. Must not be null.
      ciphertext - A cipher text. Must be either CBORByteArray or CBORNull.
  • Method Details

    • getCiphertext

      public CBORItem getCiphertext()
      Get the cipher text.

      The type of the value is CBORByteArray or CBORNull.

      Returns:
      The cipher text.
    • build

      public static COSEEncrypt0 build(CBORItem item) throws COSEException
      Build a COSEEncrypt0 instance from the given CBOR data item. The data item must be a CBOR array.
      Parameters:
      item - A CBOR data item that represents COSE_Encrypt0.
      Returns:
      A COSEEncrypt0 instance built from the given CBOR data item.
      Throws:
      COSEException
    • build

      public static COSEEncrypt0 build(List<Object> list) throws COSEException
      Build a COSEEncrypt0 instance from the given object list.
      Parameters:
      list - A object list that represents COSE_Encrypt0.
      Returns:
      A COSEEncrypt0 instance built from the given object list.
      Throws:
      COSEException