Package software.amazon.awssdk.crt.io
Class Pkcs11Lib
- java.lang.Object
-
- software.amazon.awssdk.crt.CrtResource
-
- software.amazon.awssdk.crt.io.Pkcs11Lib
-
- All Implemented Interfaces:
AutoCloseable
public class Pkcs11Lib extends CrtResource
Handle to a loaded PKCS#11 library. For most use cases, a single instance of Pkcs11Lib should be used for the lifetime of your application.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Pkcs11Lib.InitializeFinalizeBehavior
Controls how Pkcs11Lib callsC_Initialize()
andC_Finalize()
on the PKCS#11 library.-
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance
-
-
Constructor Summary
Constructors Constructor Description Pkcs11Lib(String path)
Load and initialize a PKCS#11 library.Pkcs11Lib(String path, Pkcs11Lib.InitializeFinalizeBehavior initializeFinalizeBehavior)
Load a PKCS#11 library, specifying howC_Initialize()
andC_Finalize()
will be called.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canReleaseReferencesImmediately()
Override that determines whether a resource releases its dependencies at the same time the native handle is released or if it waits.protected void
releaseNativeHandle()
Required override method that must begin the release process of the acquired native handle-
Methods inherited from class software.amazon.awssdk.crt.CrtResource
acquireNativeHandle, addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getNativeHandle, getResourceLogDescription, isNull, logNativeResources, releaseReferences, removeReferenceTo, setDescription, swapReferenceTo, waitForNoResources
-
-
-
-
Constructor Detail
-
Pkcs11Lib
public Pkcs11Lib(String path)
Load and initialize a PKCS#11 library.C_Initialize()
andC_Finalize()
are called on the PKCS#11 library in theDEFAULT
way.- Parameters:
path
- path to PKCS#11 library.
-
Pkcs11Lib
public Pkcs11Lib(String path, Pkcs11Lib.InitializeFinalizeBehavior initializeFinalizeBehavior)
Load a PKCS#11 library, specifying howC_Initialize()
andC_Finalize()
will be called.- Parameters:
path
- path to PKCS#11 library.initializeFinalizeBehavior
- specifies howC_Initialize()
andC_Finalize()
will be called on the PKCS#11 library.
-
-
Method Detail
-
canReleaseReferencesImmediately
protected boolean canReleaseReferencesImmediately()
Description copied from class:CrtResource
Override that determines whether a resource releases its dependencies at the same time the native handle is released or if it waits. Resources with asynchronous shutdown processes should override this with false, and establish a callback from native code that invokes releaseReferences() when the asynchronous shutdown process has completed. See HttpClientConnectionManager for an example.- Specified by:
canReleaseReferencesImmediately
in classCrtResource
- Returns:
- true if this resource releases synchronously, false if this resource performs async shutdown
-
releaseNativeHandle
protected void releaseNativeHandle()
Description copied from class:CrtResource
Required override method that must begin the release process of the acquired native handle- Specified by:
releaseNativeHandle
in classCrtResource
-
-