Package io.grpc
Class TlsChannelCredentials.Builder
java.lang.Object
io.grpc.TlsChannelCredentials.Builder
- Enclosing class:
TlsChannelCredentials
Builder for
TlsChannelCredentials
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]
private boolean
private List
<KeyManager> private byte[]
private String
private byte[]
private List
<TrustManager> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Construct the credentials.private void
private void
keyManager
(File certChain, File privateKey) Use the provided certificate chain and private key as the client's identity.keyManager
(File certChain, File privateKey, String privateKeyPassword) Use the provided certificate chain and possibly-encrypted private key as the client's identity.keyManager
(InputStream certChain, InputStream privateKey) Use the provided certificate chain and private key as the client's identity.keyManager
(InputStream certChain, InputStream privateKey, String privateKeyPassword) Use the provided certificate chain and possibly-encrypted private key as the client's identity.keyManager
(KeyManager... keyManagers) Have the provided key manager select the client's identity.RequiresTlsChannelCredentials.Feature.FAKE
to be understood.trustManager
(File rootCerts) Use the provided root certificates to verify the server's identity instead of the system's default.trustManager
(InputStream rootCerts) Use the provided root certificates to verify the server's identity instead of the system's default.trustManager
(TrustManager... trustManagers) Have the provided trust manager verify the server's identity instead of the system's default.
-
Field Details
-
fakeFeature
private boolean fakeFeature -
certificateChain
private byte[] certificateChain -
privateKey
private byte[] privateKey -
privateKeyPassword
-
keyManagers
-
rootCertificates
private byte[] rootCertificates -
trustManagers
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
requireFakeFeature
RequiresTlsChannelCredentials.Feature.FAKE
to be understood. For use in testing consumers of this credential. -
keyManager
Use the provided certificate chain and private key as the client's identity. Generally they should be PEM-encoded and the key is an unencrypted PKCS#8 key (file headers have "BEGIN CERTIFICATE" and "BEGIN PRIVATE KEY").- Throws:
IOException
-
keyManager
public TlsChannelCredentials.Builder keyManager(File certChain, File privateKey, String privateKeyPassword) throws IOException Use the provided certificate chain and possibly-encrypted private key as the client's identity. Generally they should be PEM-encoded and the key is a PKCS#8 key. If the private key is unencrypted, then password must benull
.- Throws:
IOException
-
keyManager
public TlsChannelCredentials.Builder keyManager(InputStream certChain, InputStream privateKey) throws IOException Use the provided certificate chain and private key as the client's identity. Generally they should be PEM-encoded and the key is an unencrypted PKCS#8 key (file headers have "BEGIN CERTIFICATE" and "BEGIN PRIVATE KEY").- Throws:
IOException
-
keyManager
public TlsChannelCredentials.Builder keyManager(InputStream certChain, InputStream privateKey, String privateKeyPassword) throws IOException Use the provided certificate chain and possibly-encrypted private key as the client's identity. Generally they should be PEM-encoded and the key is a PKCS#8 key. If the private key is unencrypted, then password must benull
.- Throws:
IOException
-
keyManager
Have the provided key manager select the client's identity. Although multiple are allowed, only the first instance implementing a particular interface is used. So generally there will just be a single entry and it implementsX509KeyManager
. -
clearKeyManagers
private void clearKeyManagers() -
trustManager
Use the provided root certificates to verify the server's identity instead of the system's default. Generally they should be PEM-encoded with all the certificates concatenated together (file header has "BEGIN CERTIFICATE", and would occur once per certificate).- Throws:
IOException
-
trustManager
Use the provided root certificates to verify the server's identity instead of the system's default. Generally they should be PEM-encoded with all the certificates concatenated together (file header has "BEGIN CERTIFICATE", and would occur once per certificate).- Throws:
IOException
-
trustManager
Have the provided trust manager verify the server's identity instead of the system's default. Although multiple are allowed, only the first instance implementing a particular interface is used. So generally there will just be a single entry and it implementsX509TrustManager
. -
clearTrustManagers
private void clearTrustManagers() -
build
Construct the credentials.
-