tuweni / org.apache.tuweni.net.tls / TrustManagerFactories / whitelistServers

whitelistServers

static fun whitelistServers(knownServersFile: Path): TrustManagerFactory (source)

Require servers to present known certificates, or CA-signed certificates.

If a certificate is not CA-signed, then its fingerprint must be present in the knownServersFile, associated with the server (identified by host+port).

Parameters

knownServersFile - The path to the file containing fingerprints by host.

Return
A trust manager factory.

static fun whitelistServers(repository: FingerprintRepository): TrustManagerFactory (source)

Require servers to present known certificates, or CA-signed certificates.

If a certificate is not CA-signed, then its fingerprint must be present in the knownServersFile, associated with the server (identified by host+port).

Parameters

repository - The repository in which to record fingerprints by host.

Return
A trust manager factory.

static fun whitelistServers(knownServersFile: Path, acceptCASigned: Boolean): TrustManagerFactory (source)

Require servers to present known certificates.

The fingerprint for a server certificate must be present in the knownServersFile, associated with the server (identified by host+port).

Parameters

knownServersFile - The path to the file containing fingerprints by host.

acceptCASigned - If true, CA-signed certificates will always be accepted.

Return
A trust manager factory.

static fun whitelistServers(repository: FingerprintRepository, acceptCASigned: Boolean): TrustManagerFactory (source)

Require servers to present known certificates.

The fingerprint for a server certificate must be present in the knownServersFile, associated with the server (identified by host+port).

Parameters

repository - The repository in which to record fingerprints by host.

acceptCASigned - If true, CA-signed certificates will always be accepted.

Return
A trust manager factory.

static fun whitelistServers(knownServersFile: Path, tmf: TrustManagerFactory): TrustManagerFactory (source)

Require servers to present known certificates, or CA-signed certificates.

If a certificate is not CA-signed, then its fingerprint must be present in the knownServersFile, associated with the server (identified by host+port).

Parameters

knownServersFile - The path to the file containing fingerprints by host.

tmf - A TrustManagerFactory for checking server certificates against a CA.

Return
A trust manager factory.

static fun whitelistServers(repository: FingerprintRepository, tmf: TrustManagerFactory): TrustManagerFactory (source)

Require servers to present known certificates, or CA-signed certificates.

If a certificate is not CA-signed, then its fingerprint must be present in the knownServersFile, associated with the server (identified by host+port).

Parameters

repository - The repository in which to record fingerprints by host.

tmf - A TrustManagerFactory for checking server certificates against a CA.

Return
A trust manager factory.