Enum SymmetricKey.Usage

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<SymmetricKey.Usage>
    Enclosing interface:
    SymmetricKey

    public static enum SymmetricKey.Usage
    extends java.lang.Enum<SymmetricKey.Usage>
    In PKCS #11, each key can be marked with the operations it will be used to perform. Some tokens require that a key be marked for an operation before the key can be used to perform that operation; other tokens don't care.

    When you unwrap a symmetric key, you must specify which one of these operations it will be used to perform.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      long getPKCS11Constant()
      Deprecated.
      Use value() to get PKCS #11 CKF_ value instead.
      int getVal()
      Deprecated.
      Use ordinal() instead.
      long value()
      Get PKCS #11 CKF_ value.
      static SymmetricKey.Usage valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static SymmetricKey.Usage[] 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, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • values

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

        public static SymmetricKey.Usage 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
      • getVal

        @Deprecated
        public int getVal()
        Deprecated.
        Use ordinal() instead.
      • value

        public long value()
        Get PKCS #11 CKF_ value.
      • getPKCS11Constant

        @Deprecated
        public long getPKCS11Constant()
        Deprecated.
        Use value() to get PKCS #11 CKF_ value instead.
        Get PKCS #11 CKA_ value.