Top Description Fields Constructors Methods
io.vertx.core.net

pack-priv Class TrustManagerFactoryOptions

extends Object
implements TrustOptions
Class Inheritance
All Implemented Interfaces
io.vertx.core.net.TrustOptions
Imports
io.vertx.core.Vertx, javax.net.ssl.TrustManager, .TrustManagerFactory, java.util.function.Function

Trust options configuring trusted certificates based on TrustManagerFactory or TrustManager.
InputStream trustStoreStream = null;
KeyStore trustStore = KeyStore.getInstance("JKS");
trustStore.load(trustStoreStream, "truststore-password".toCharArray());

TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init(trustStore);

HttpServerOptions options = HttpServerOptions.httpServerOptions();
options.setTrustOptions(new TrustManagerFactoryOptions(keyManagerFactory));

// or with a TrustManager

TrustManager trustManager = trustManagerFactory.getTrustManagers()[0];
options.setTrustOptions(new TrustManagerFactoryOptions(trustManager));
As this class is not available because it is part of the internal api the proper usage would be:
// with a TrustManager
options.setTrustOptions(TrustOptions.wrap(trustManager));

// with a TrustManagerFactory
options.setTrustOptions(TrustOptions.wrap(trustManagerFactory));
Author
Hakan Altindag

Field Summary

Modifier and TypeField and Description
private final TrustManagerFactory

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
private

Method Summary

Modifier and TypeMethod and Description
public TrustOptions
public TrustManagerFactory
getTrustManagerFactory(Vertx
the vertx instance
vertx
)

Implements io.vertx.core.net.TrustOptions.getTrustManagerFactory.

Create and return the trust manager factory for these options.

public Function<String, TrustManager[]>
trustManagerMapper(Vertx
the vertx instance
vertx
)

Implements io.vertx.core.net.TrustOptions.trustManagerMapper.

Returns a function that maps SNI server names to a TrustManagerFactory instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

trustManagerFactoryback to summary
private final TrustManagerFactory trustManagerFactory

Constructor Detail

TrustManagerFactoryOptionsback to summary
pack-priv TrustManagerFactoryOptions(TrustManagerFactory trustManagerFactory)
TrustManagerFactoryOptionsback to summary
pack-priv TrustManagerFactoryOptions(TrustManager trustManager)
TrustManagerFactoryOptionsback to summary
private TrustManagerFactoryOptions(TrustManagerFactoryOptions other)

Method Detail

copyback to summary
public TrustOptions copy()

Implements io.vertx.core.net.TrustOptions.copy.

Returns:TrustOptions

Doc from io.vertx.core.net.TrustOptions.copy.

a copy of these options

Annotations
@Override
getTrustManagerFactoryback to summary
public TrustManagerFactory getTrustManagerFactory(Vertx vertx)

Implements io.vertx.core.net.TrustOptions.getTrustManagerFactory.

Doc from io.vertx.core.net.TrustOptions.getTrustManagerFactory.

Create and return the trust manager factory for these options.

The returned trust manager factory should be already initialized and ready to use.

Parameters
vertx:Vertx

the vertx instance

Returns:TrustManagerFactory

the trust manager factory

Annotations
@Override
trustManagerMapperback to summary
public Function<String, TrustManager[]> trustManagerMapper(Vertx vertx)

Implements io.vertx.core.net.TrustOptions.trustManagerMapper.

Doc from io.vertx.core.net.TrustOptions.trustManagerMapper.

Returns a function that maps SNI server names to a TrustManagerFactory instance. The returned TrustManagerFactory must already be initialized and ready to use. The mapper is only used when the server has SNI enabled and the client indicated a server name.

The returned function may return null in which case getTrustManagerFactory(Vertx) is used as fallback.

Parameters
vertx:Vertx

the vertx instance

Returns:Function<String, TrustManager[]>

the trustManager

Annotations
@Override