Package software.amazon.awssdk.crt.io
Class TlsContextPkcs11Options
java.lang.Object
software.amazon.awssdk.crt.CrtResource
software.amazon.awssdk.crt.io.TlsContextPkcs11Options
- All Implemented Interfaces:
AutoCloseable
Options for TLS using a PKCS#11 library for private key operations.
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionwithCertificateFileContents(String contents) Use this X.509 certificate (contents in memory).Use this X.509 certificate (file on disk).withPrivateKeyObjectLabel(String label) Specify the label of the private key object on the PKCS#11 token.withSlotId(long slotId) Specify the slot ID containing a PKCS#11 token.withTokenLabel(String label) Specify the label of the PKCS#11 token to use.withUserPin(String pin) Use this PIN to log the user into the PKCS#11 token.Methods inherited from class software.amazon.awssdk.crt.CrtResource
addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getNativeHandle, getResourceLogDescription, isNull, logNativeResources, logNativeResources, removeReferenceTo, setDescription, waitForNoResources
-
Constructor Details
-
TlsContextPkcs11Options
Constructor- Parameters:
pkcs11Lib- use this PKCS#11 library
-
-
Method Details
-
withUserPin
Use this PIN to log the user into the PKCS#11 token. Leave unspecified to log into a token with a "protected authentication path".- Parameters:
pin- PIN- Returns:
- this
-
withSlotId
Specify the slot ID containing a PKCS#11 token. If not specified, the token will be chosen based on other criteria (such as token label).- Parameters:
slotId- slot ID- Returns:
- this
-
withTokenLabel
Specify the label of the PKCS#11 token to use. If not specified, the token will be chosen based on other criteria (such as slot ID).- Parameters:
label- label of token- Returns:
- this
-
withPrivateKeyObjectLabel
Specify the label of the private key object on the PKCS#11 token. If not specified, the key will be chosen based on other criteria (such as being the only available private key on the token).- Parameters:
label- label of private key object- Returns:
- this
-
withCertificateFilePath
Use this X.509 certificate (file on disk). The certificate may be specified by other means instead (ex:withCertificateFileContents(java.lang.String))- Parameters:
path- path to PEM-formatted certificate file on disk.- Returns:
- this
-
withCertificateFileContents
Use this X.509 certificate (contents in memory). The certificate may be specified by other means instead (ex:withCertificateFilePath(java.lang.String))- Parameters:
contents- contents of PEM-formatted certificate file.- Returns:
- this
-