Enum HeaderParameterKey

  • All Implemented Interfaces:
    Serializable, Comparable<HeaderParameterKey>

    public enum HeaderParameterKey
    extends Enum<HeaderParameterKey>
    Representation of COSE header parameter keys.

    Only those relevant for our use case are represented.

    Author:
    Martin Lindström (martin@idsec.se), Henrik Bengtsson (extern.henrik.bengtsson@digg.se), Henric Norlander (extern.henric.norlander@digg.se)
    • Enum Constant Detail

      • CONTENT_TYPE

        public static final HeaderParameterKey CONTENT_TYPE
        This parameter is used to indicate the content type of the data in the payload or ciphertext fields.
      • KID

        public static final HeaderParameterKey KID
        This parameter identifies one piece of data that can be used as input to find the needed cryptographic key.
    • Method Detail

      • values

        public static HeaderParameterKey[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (HeaderParameterKey c : HeaderParameterKey.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static HeaderParameterKey valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • fromCborObject

        public static HeaderParameterKey fromCborObject​(com.upokecenter.cbor.CBORObject value)
        Given a CBOR object the method gets the corresponding HeaderParameterKey.
        Parameters:
        value - the value
        Returns:
        a HeaderParameterKey
      • fromValue

        public static HeaderParameterKey fromValue​(int value)
        Given a value the method gets the corresponding HeaderParameterKey.
        Parameters:
        value - the value
        Returns:
        a HeaderParameterKey
      • getCborObject

        public com.upokecenter.cbor.CBORObject getCborObject()
        Gets the header parameter key as a CBOR object.
        Returns:
        a CBORObject
      • getValue

        public int getValue()
        Gets the CBOR value for the header parameter key.
        Returns:
        the value