Class COSESignature


public class COSESignature extends COSEObject
COSE_Signature

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

 COSE_Signature =  [
     Headers,
     signature : bstr
 ]
 
Since:
1.1
See Also:
  • Constructor Details

    • COSESignature

      public COSESignature(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, byte[] signature)
      A constructor with a protected header, an unprotected header and a signature.
      Parameters:
      protectedHeader - A protected header. Must not be null.
      unprotectedHeader - An unprotected header. Must not be null.
      signature - A signature. Must not be null.
    • COSESignature

      public COSESignature(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORByteArray signature)
      A constructor with a protected header, an unprotected header and a signature.
      Parameters:
      protectedHeader - A protected header. Must not be null.
      unprotectedHeader - An unprotected header. Must not be null.
      signature - A signature. Must not be null.
  • Method Details

    • getSignature

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

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

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