keyManager

Available in a dev version: 0․11․0-grpc-186

How to configure

abstract fun keyManager(certChainPem: String, privateKeyPem: String): GrpcTlsClientCredentialsBuilder(source)

Configures the key manager with client certificate and private key for mutual TLS (mTLS).

The key manager enables the client to authenticate itself to the server. This is required when the server is configured to require or request client certificates.

Example

TlsClientCredentials {
trustManager(caCertPem)
keyManager(
certChainPem = """
-----BEGIN CERTIFICATE-----
MIIDXTCCAkWgAwIBAgIJAKl...
-----END CERTIFICATE-----
""".trimIndent(),
privateKeyPem = """
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0...
-----END PRIVATE KEY-----
""".trimIndent()
)
}

Return

This builder for chaining.

Parameters

certChainPem

PEM-encoded certificate chain for the client, starting with the client certificate.

privateKeyPem

PEM-encoded private key corresponding to the client certificate.

See also