Class SpiffeSslContextFactory
java.lang.Object
io.spiffe.provider.SpiffeSslContextFactory
Utility class to create instances of
SSLContext initialized with a SpiffeKeyManager and
a SpiffeTrustManager that are backed by the Workload API.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic SSLContextgetSslContext(@NonNull SpiffeSslContextFactory.SslContextOptions options) Creates anSSLContextinitialized with aSpiffeKeyManagerandSpiffeTrustManagerthat are backed by the Workload API via anDefaultX509Source.
-
Method Details
-
getSslContext
public static SSLContext getSslContext(@NonNull @NonNull SpiffeSslContextFactory.SslContextOptions options) throws NoSuchAlgorithmException, KeyManagementException Creates anSSLContextinitialized with aSpiffeKeyManagerandSpiffeTrustManagerthat are backed by the Workload API via anDefaultX509Source.- Parameters:
options-SpiffeSslContextFactory.SslContextOptions. The optionDefaultX509Sourcemust be not null. If the optionacceptedSpiffeIdsSupplieris not provided, the Set of accepted SPIFFE IDs is read from the Security or System Propertyssl.spiffe.accept. If the sslProtocol is not provided, the default TLSv1.2 is used.- Returns:
- an initialized
SSLContext - Throws:
IllegalArgumentException- if theDefaultX509Sourceis not provided in the optionsNoSuchAlgorithmException- if there is a problem creating the SSL contextKeyManagementException- if there is a problem initializing the SSL context
-