Module org.eclipse.jgit.ssh.apache
Class Pkcs11Provider
java.lang.Object
org.eclipse.jgit.internal.transport.sshd.pkcs11.Pkcs11Provider
Bridge for using a PKCS11 HSM (Hardware Security Module) for public-key
authentication.
-
Method Summary
Modifier and TypeMethodDescriptionIterable<org.apache.sshd.client.auth.pubkey.KeyAgentIdentity>getKeys(org.apache.sshd.common.session.SessionContext session) Obtains the identities provided by the PKCS11 library.getName()Retrieves an identifying name of thisPkcs11Provider.static Pkcs11ProvidergetProvider(Path library, int slotListIndex) Creates a newPkcs11Provider.
-
Method Details
-
getProvider
public static Pkcs11Provider getProvider(@NonNull Path library, int slotListIndex) throws IOException Creates a newPkcs11Provider.- Parameters:
library-Pathto the library the SunPKCS11 provider shall useslotListIndex- index identifying the token; if < 0, ignored and 0 is used- Returns:
- a new
Pkcs11Provider, ornullif SunPKCS11 is not available - Throws:
IOException- if the configuration file cannot be createdProviderException- if the JavaProviderencounters a problemUnsupportedOperationException- if PKCS#11 is unsupported
-
getName
Retrieves an identifying name of thisPkcs11Provider.- Returns:
- the name
-
getKeys
public Iterable<org.apache.sshd.client.auth.pubkey.KeyAgentIdentity> getKeys(org.apache.sshd.common.session.SessionContext session) throws IOException, GeneralSecurityException Obtains the identities provided by the PKCS11 library.- Parameters:
session- in which we to load the identities- Returns:
- all the available identities
- Throws:
IOException- if keys cannot be accessedGeneralSecurityException- if keys cannot be accessed
-