Class COSESign


public class COSESign extends COSEMessage
COSE_Sign

COSE_Sign is defined in 4.1. Signing with One or More Signers of RFC 9052 as follows.

 COSE_Sign = [
     Headers,
     payload : bstr / nil,
     signatures : [+ COSE_Signature]
 ]
 
Since:
1.1
See Also:
  • Constructor Details

    • COSESign

      public COSESign(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem payload, CBORItemList signatures)
      A constructor with a protected header, an unprotected header, a payload and signatures.
      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.
      signatures - Signatures. Must not be null. Items in the list must be instances of COSESignature. At least one element must be contained.
  • Method Details

    • getPayload

      public CBORItem getPayload()
      Get the payload.

      The type of the value is CBORByteArray or CBORNull.

      Returns:
      The payload.
    • getSignatures

      public CBORItemList getSignatures()
      Get the list of signatures. Items in the list are COSESignature instances.
      Returns:
      The list of signatures.
    • build

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

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