Class COSEUnprotectedHeader


public class COSEUnprotectedHeader extends CBORPairList
COSE Unprotected Header
Since:
1.1
See Also:
  • Constructor Details

  • Method Details

    • getParameters

      public Map<Object,Object> getParameters()
      Get the set of parameters of this header as a Map.
      Returns:
      The set of parameters of this header.
    • getAlg

      public Object getAlg()
      Get the value of the "alg (1)" parameter.

      The type of the value is an integer (int, long or BigInteger) or a string (String).

      Returns:
      The value of the "alg (1)" parameter. If the header does not contain the parameter, null is returned.
      See Also:
    • getContentType

      public Object getContentType()
      Get the value of the "content type (3)" parameter.

      The type of the value is an unsigned integer (int, long or BigInteger) or a string (String).

      Returns:
      The value of the "content type (3)" parameter. If the header does not contain the parameter, null is returned.
    • getKid

      public byte[] getKid()
      Get the value of the "kid (4)" parameter.
      Returns:
      The value of the "kid (4)" parameter. If the header does not contain the parameter, null is returned.
    • getIv

      public byte[] getIv()
      Get the value of the "IV (5)" parameter.
      Returns:
      The value of the "IV (5)" parameter. If the header does not contain the parameter, null is returned.
    • getPartialIv

      public byte[] getPartialIv()
      Get the value of the "Partial IV (6)" parameter.
      Returns:
      The value of the "Partial IV (6)" parameter. If the header does not contain the parameter, null is returned.
    • getX5Chain

      public List<X509Certificate> getX5Chain()
      Get the value of the "x5chain (33)" parameter.
      Returns:
      The value of the "x5chain (33)" parameter. If the header does not contain the parameter, null is returned.
      Since:
      1.2
    • build

      public static COSEUnprotectedHeader build(CBORItem header) throws COSEException
      Interpret the given CBOR data item as an unprotected header and build an instance of COSEUnprotectedHeader from it.
      Parameters:
      header - A CBOR data item that represents a protected header. It must be a CBOR map.
      Returns:
      An unprotected header.
      Throws:
      COSEException - The given CBOR data item does not conform to the requirements of unprotected header.
    • build

      public static COSEUnprotectedHeader build(Map<Object,Object> map)
      Build a COSEUnprotectedHeader instance from the given map.
      Parameters:
      map - A map containing header parameters.
      Returns:
      A COSEUnprotectedHeader instance built from the given map.