Package software.amazon.awssdk.crt.io
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 callsC_Initialize()
andC_Finalize()
on the PKCS#11 library.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Pkcs11Lib.InitializeFinalizeBehavior
valueOf(String name)
Returns the enum constant of this type with the specified name.static Pkcs11Lib.InitializeFinalizeBehavior[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
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 callingC_Initialize()
andC_Finalize()
. Use this if your application has already initialized the PKCS#11 library, and you do not wantC_Initialize()
called again.
-
STRICT
public static final Pkcs11Lib.InitializeFinalizeBehavior STRICT
C_Initialize()
is called on creation andC_Finalize()
is called on cleanup. IfC_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 nameNullPointerException
- if the argument is null
-
-