Class SpiffeKeyManager
java.lang.Object
javax.net.ssl.X509ExtendedKeyManager
io.spiffe.provider.SpiffeKeyManager
- All Implemented Interfaces:
KeyManager,X509KeyManager
Represents an X.509 key manager for the SPIFFE provider.
Provides the chain of X.509 certificates and the private key to be used in secure socket negotiations.
-
Constructor Summary
ConstructorsConstructorDescriptionSpiffeKeyManager(@NonNull io.spiffe.svid.x509svid.X509SvidSource x509SvidSource) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionchooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket) chooseEngineClientAlias(String[] keyTypes, Principal[] issuers, SSLEngine sslEngine) chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine sslEngine) chooseServerAlias(String keyType, Principal[] issuers, Socket socket) getCertificateChain(String alias) Returns the X.509 certificates chain associated with the given alias.String[]getClientAliases(String keyType, Principal[] issuers) getPrivateKey(String alias) Returns the private key handled by this key manager.String[]getServerAliases(String keyType, Principal[] issuers)
-
Constructor Details
-
SpiffeKeyManager
public SpiffeKeyManager(@NonNull @NonNull io.spiffe.svid.x509svid.X509SvidSource x509SvidSource) Constructor.- Parameters:
x509SvidSource- source of X.509 SVIDs
-
-
Method Details
-
getCertificateChain
Returns the X.509 certificates chain associated with the given alias.- Returns:
- the certificate chain (ordered with the leaf certificate first and the intermediate CA certificates), or an empty Array if the alias is not 'Spiffe'.
-
getPrivateKey
Returns the private key handled by this key manager.- Parameters:
alias- a key entry, as this KeyManager only handles one identity, i.e. one SVID, it will return the PrivateKey if the given alias is 'Spiffe'.- Returns:
- the
PrivateKeyhandled by this key manager, or null if the alias is not 'Spiffe'
-
getClientAliases
-
chooseClientAlias
-
chooseEngineClientAlias
- Overrides:
chooseEngineClientAliasin classX509ExtendedKeyManager
-
getServerAliases
-
chooseEngineServerAlias
- Overrides:
chooseEngineServerAliasin classX509ExtendedKeyManager
-
chooseServerAlias
-