Enum ModeOfUse

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ModeOfUse>

    public enum ModeOfUse
    extends java.lang.Enum<ModeOfUse>
    Defines the operation that the key contained in the key block can perform.

    Each value represents byte 8 of the Keyblok Header.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ANY
      No special restrictions apply.
      DECONLY
      The key may only be used to perform decrypt operations.
      DERIVE
      The key may only be used to derive other keys.
      ENCDEC
      The key may be used to perform both encrypt and decrypt operations.
      ENCONLY
      The key may only be used to perform encrypt operations.
      GENONLY
      The key may only be used to perform MAC generate operations.
      GENSIGN
      The key may only be used to perform digital signature generation operations.
      GENVER
      The key may be used to perform MAC calculation (both generate & verify) operations.
      KEYVAR
      The key may be used to create key variants.
      SIGNVER
      The key may be used to perform both digital signature generation and verification operations.
      VERONLY
      The key may only be used to perform digital signature verification operations.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      char getCode()
      Get code of key use mode.
      java.lang.String getName()
      Get name of key use mode.
      java.lang.String toString()  
      static ModeOfUse valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ModeOfUse valueOfByCode​(char code)
      Returns the enum constant of this type with the specified code.
      static ModeOfUse[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • ENCDEC

        public static final ModeOfUse ENCDEC
        The key may be used to perform both encrypt and decrypt operations.
      • GENVER

        public static final ModeOfUse GENVER
        The key may be used to perform MAC calculation (both generate & verify) operations.
      • DECONLY

        public static final ModeOfUse DECONLY
        The key may only be used to perform decrypt operations.
      • ENCONLY

        public static final ModeOfUse ENCONLY
        The key may only be used to perform encrypt operations.
      • GENONLY

        public static final ModeOfUse GENONLY
        The key may only be used to perform MAC generate operations.
      • ANY

        public static final ModeOfUse ANY
        No special restrictions apply.
      • GENSIGN

        public static final ModeOfUse GENSIGN
        The key may only be used to perform digital signature generation operations.
      • SIGNVER

        public static final ModeOfUse SIGNVER
        The key may be used to perform both digital signature generation and verification operations.
      • VERONLY

        public static final ModeOfUse VERONLY
        The key may only be used to perform digital signature verification operations.
      • DERIVE

        public static final ModeOfUse DERIVE
        The key may only be used to derive other keys.
      • KEYVAR

        public static final ModeOfUse KEYVAR
        The key may be used to create key variants.
    • Method Detail

      • values

        public static ModeOfUse[] 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 (ModeOfUse c : ModeOfUse.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ModeOfUse valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getCode

        public char getCode()
        Get code of key use mode.
        Returns:
        the character which represents code of key use mode
      • getName

        public java.lang.String getName()
        Get name of key use mode.
        Returns:
        the name of key use mode.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<ModeOfUse>
      • valueOfByCode

        public static ModeOfUse valueOfByCode​(char code)
        Returns the enum constant of this type with the specified code.
        Parameters:
        code - the string must match exactly with identifier specified by ISO 8583-1:2003(E) Table A.22 — Transaction type codes
        Returns:
        the enum constant with the specified processing code or null if unknown.