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()
)
}Content copied to clipboard
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.