Class COSESign1


public class COSESign1 extends COSEMessage
COSE_Sign1

COSE_Sign1 is defined in 4.2. Signing with One Signer of RFC 9052 as follows.

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

    • COSESign1

      public COSESign1(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem payload, CBORByteArray signature)
      A constructor with a protected header, an unprotected header, a payload and a signature.
      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.
      signature - A signature. 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.
    • getSignature

      public CBORByteArray getSignature()
      Get the signature.
      Returns:
      The signature.
    • build

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

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