Enum Pkcs11Lib.InitializeFinalizeBehavior

java.lang.Object
java.lang.Enum<Pkcs11Lib.InitializeFinalizeBehavior>
software.amazon.awssdk.crt.io.Pkcs11Lib.InitializeFinalizeBehavior
All Implemented Interfaces:
Serializable, Comparable<Pkcs11Lib.InitializeFinalizeBehavior>
Enclosing class:
Pkcs11Lib

public static enum Pkcs11Lib.InitializeFinalizeBehavior extends Enum<Pkcs11Lib.InitializeFinalizeBehavior>
Controls how Pkcs11Lib calls C_Initialize() and C_Finalize() on the PKCS#11 library.
  • Enum Constant Details

    • DEFAULT

      public static final Pkcs11Lib.InitializeFinalizeBehavior DEFAULT
      Default behavior that accommodates most use cases. C_Initialize() is called on creation, and "already-initialized" errors are ignored. C_Finalize() is never called, just in case another part of your application is still using the PKCS#11 library.
    • OMIT

      public static final Pkcs11Lib.InitializeFinalizeBehavior OMIT
      Skip calling C_Initialize() and C_Finalize(). Use this if your application has already initialized the PKCS#11 library, and you do not want C_Initialize() called again.
    • STRICT

      public static final Pkcs11Lib.InitializeFinalizeBehavior STRICT
      C_Initialize() is called on creation and C_Finalize() is called on cleanup. If C_Initialize() reports that's it's already initialized, this is treated as an error. Use this if you need perfect cleanup (ex: running valgrind with --leak-check).
  • Method Details

    • values

      public static Pkcs11Lib.InitializeFinalizeBehavior[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Pkcs11Lib.InitializeFinalizeBehavior 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