Class COSEMac0


public class COSEMac0 extends COSEMessage
COSE_Mac0

COSE_Mac0 is defined in 6.2. MACed Message with Implicit Key of RFC 9052 as follows.

 COSE_Mac0 = [
     Headers,
     payload : bstr / nil,
     tag : bstr,
 ]
 
Since:
1.1
See Also:
  • Constructor Details

    • COSEMac0

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

    • getPayload

      public CBORItem getPayload()
      Get the payload.

      The type of the value is CBORByteArray or CBORNull.

      Returns:
      The payload.
    • getTag

      public CBORByteArray getTag()
      Get the tag.
      Returns:
      The tag.
    • build

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

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