Class COSEEncrypt


public class COSEEncrypt extends COSEMessage
COSE_Encrypt

COSE_Encrypt is defined in 5.1. Enveloped COSE Structure of RFC 9052 as follows.

 COSE_Encrypt = [
     Headers,
     ciphertext : bstr / nil,
     recipients : [+COSE_recipient]
 ]
 
Since:
1.1
See Also:
  • Constructor Details

    • COSEEncrypt

      public COSEEncrypt(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem ciphertext, CBORItemList recipients)
      A constructor with a protected header, an unprotected header, a cipher text and recipients.
      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.
      recipients - Recipients. Must not be null. Items in the list must be instances of COSERecipient. At least one element must be contained.
  • Method Details

    • getCiphertext

      public CBORItem getCiphertext()
      Get the cipher text.

      The type of the value is CBORByteArray or CBORNull.

      Returns:
      The cipher text.
    • getRecipients

      public CBORItemList getRecipients()
      Get the list of recipients. Items in the list are COSERecipient instances.
      Returns:
      The list of recipients.
    • build

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

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