Enum Pkcs11Lib.InitializeFinalizeBehavior

    • Enum Constant Detail

      • 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 Detail

      • values

        public static Pkcs11Lib.InitializeFinalizeBehavior[] 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 (Pkcs11Lib.InitializeFinalizeBehavior c : Pkcs11Lib.InitializeFinalizeBehavior.values())
            System.out.println(c);
        
        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