incomprehensible()
method. Unless overridden by a Feature, server identity is provided via getCertificateChain, getPrivateKey, and getPrivateKeyPassword.
| Modifier and Type | Class and Description |
|---|---|
| public static class | TlsServerCredentials.Builder
Builder for |
| public static enum | TlsServerCredentials.ClientAuth
The level of authentication the server should expect from the client. |
| public static enum | TlsServerCredentials.Feature
Features to understand TLS configuration. |
| Modifier and Type | Field and Description |
|---|---|
| private final byte[] | |
| private final TlsServerCredentials. | |
| private final boolean | |
| private final List | |
| private final byte[] | |
| private final String | |
| private final byte[] | |
| private final List |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public static ServerCredentials | |
| public static ServerCredentials | create(InputStream certChain, InputStream privateKey)
Creates an instance using provided certificate chain and private key. |
| public byte[] | |
| public TlsServerCredentials. | |
| public List | |
| public byte[] | |
| public String | |
| public byte[] | getRootCertificates()
Root trust certificates for verifying the client's identity that override the system's defaults. |
| public List | |
| public Set | Returns: empty set if the caller can adequately understand the configurationthe features understood by the caller understoodFeaturesReturns an empty set if this credential can be adequately understood via the features listed, otherwise returns a hint of features that are lacking to understand the configuration to be used for manual debugging. |
| public static TlsServerCredentials. | |
| private static void | requiredFeature(Set<TlsServerCredentials.
|
| certificateChain | back to summary |
|---|---|
| private final byte[] certificateChain | |
| clientAuth | back to summary |
|---|---|
| private final TlsServerCredentials. | |
| fakeFeature | back to summary |
|---|---|
| private final boolean fakeFeature | |
| keyManagers | back to summary |
|---|---|
| private final List<KeyManager> keyManagers | |
| privateKey | back to summary |
|---|---|
| private final byte[] privateKey | |
| privateKeyPassword | back to summary |
|---|---|
| private final String privateKeyPassword | |
| rootCertificates | back to summary |
|---|---|
| private final byte[] rootCertificates | |
| trustManagers | back to summary |
|---|---|
| private final List<TrustManager> trustManagers | |
| TlsServerCredentials | back to summary |
|---|---|
| pack-priv TlsServerCredentials(TlsServerCredentials. | |
| create | back to summary |
|---|---|
| public static ServerCredentials create(File certChain, File privateKey) throws IOException Creates an instance using provided certificate chain and private key. Generally they should be PEM-encoded and the key is an unencrypted PKCS#8 key (file headers have "BEGIN CERTIFICATE" and "BEGIN PRIVATE KEY"). | |
| create | back to summary |
|---|---|
| public static ServerCredentials create(InputStream certChain, InputStream privateKey) throws IOException Creates an instance using provided certificate chain and private key. Generally they should be PEM-encoded and the key is an unencrypted PKCS#8 key (file headers have "BEGIN CERTIFICATE" and "BEGIN PRIVATE KEY"). The streams will not be automatically closed. | |
| getCertificateChain | back to summary |
|---|---|
| public byte[] getCertificateChain() The certificate chain for the server's identity, as a new byte array. Generally should be
PEM-encoded. If | |
| getClientAuth | back to summary |
|---|---|
| public TlsServerCredentials. Non- | |
| getKeyManagers | back to summary |
|---|---|
| public List Returns the key manager list which provides the server's identity. Entries are scanned checking
for specific types, like | |
| getPrivateKey | back to summary |
|---|---|
| public byte[] getPrivateKey() The private key for the server's identity, as a new byte array. Generally should be in PKCS#8
format. If encrypted, | |
| getPrivateKeyPassword | back to summary |
|---|---|
| public String getPrivateKeyPassword() Returns the password to decrypt the private key, or | |
| getRootCertificates | back to summary |
|---|---|
| public byte[] getRootCertificates() Root trust certificates for verifying the client's identity that override the system's defaults. Generally PEM-encoded with multiple certificates concatenated. | |
| getTrustManagers | back to summary |
|---|---|
| public List Returns the trust manager list which verifies the client's identity. Entries are scanned
checking for specific types, like | |
| incomprehensible | back to summary |
|---|---|
| public Set Returns an empty set if this credential can be adequately understood via the features listed, otherwise returns a hint of features that are lacking to understand the configuration to be used for manual debugging. An "understood" feature does not imply the caller is able to fully handle the feature. It simply means the caller understands the feature enough to use the appropriate APIs to read the configuration. The caller may support just a subset of a feature, in which case the caller would need to look at the configuration to determine if only the supported subset is used. This method may not be as simple as a set difference. There may be multiple features that can independently satisfy a piece of configuration. If the configuration is incomprehensible, all such features would be returned, even though only one may be necessary. An empty set does not imply that the credentials are fully understood. There may be optional configuration that can be ignored if not understood. Since
| |
| newBuilder | back to summary |
|---|---|
| public static TlsServerCredentials. Creates a builder for changing default configuration. There is no default key manager, so key material must be specified. The default trust manager uses the system's root certificates. By default no client authentication will occur. | |
| requiredFeature | back to summary |
|---|---|
| private static void requiredFeature(Set<TlsServerCredentials. | |
TlsServerCredentials.
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| private TlsServerCredentials. | |
| private boolean | |
| private List | |
| private byte[] | |
| private String | |
| private byte[] | |
| private List |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public ServerCredentials | |
| private void | |
| private void | |
| public TlsServerCredentials. | clientAuth(TlsServerCredentials.
Indicates whether the server should expect a client's identity. |
| public TlsServerCredentials. | keyManager(File certChain, File privateKey)
Use the provided certificate chain and private key as the server's identity. |
| public TlsServerCredentials. | keyManager(File certChain, File privateKey, String privateKeyPassword)
Use the provided certificate chain and possibly-encrypted private key as the server's identity. |
| public TlsServerCredentials. | keyManager(InputStream certChain, InputStream privateKey)
Use the provided certificate chain and private key as the server's identity. |
| public TlsServerCredentials. | keyManager(InputStream certChain, InputStream privateKey, String privateKeyPassword)
Use the provided certificate chain and possibly-encrypted private key as the server's identity. |
| public TlsServerCredentials. | |
| public TlsServerCredentials. | |
| public TlsServerCredentials. | trustManager(File rootCerts)
Use the provided root certificates to verify the client's identity instead of the system's default. |
| public TlsServerCredentials. | trustManager(InputStream rootCerts)
Use the provided root certificates to verify the client's identity instead of the system's default. |
| public TlsServerCredentials. | trustManager(TrustManager... trustManagers)
Have the provided trust manager verify the client's identity instead of the system's default. |
| certificateChain | back to summary |
|---|---|
| private byte[] certificateChain | |
| clientAuth | back to summary |
|---|---|
| private TlsServerCredentials. | |
| fakeFeature | back to summary |
|---|---|
| private boolean fakeFeature | |
| keyManagers | back to summary |
|---|---|
| private List<KeyManager> keyManagers | |
| privateKey | back to summary |
|---|---|
| private byte[] privateKey | |
| privateKeyPassword | back to summary |
|---|---|
| private String privateKeyPassword | |
| rootCertificates | back to summary |
|---|---|
| private byte[] rootCertificates | |
| trustManagers | back to summary |
|---|---|
| private List<TrustManager> trustManagers | |
| Builder | back to summary |
|---|---|
| private Builder() | |
| build | back to summary |
|---|---|
| public ServerCredentials build() Construct the credentials. | |
| clearKeyManagers | back to summary |
|---|---|
| private void clearKeyManagers() | |
| clearTrustManagers | back to summary |
|---|---|
| private void clearTrustManagers() | |
| clientAuth | back to summary |
|---|---|
| public TlsServerCredentials. Indicates whether the server should expect a client's identity. Must not be | |
| keyManager | back to summary |
|---|---|
| public TlsServerCredentials. Use the provided certificate chain and private key as the server'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"). | |
| keyManager | back to summary |
|---|---|
| public TlsServerCredentials. Use the provided certificate chain and possibly-encrypted private key as the server'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 be | |
| keyManager | back to summary |
|---|---|
| public TlsServerCredentials. Use the provided certificate chain and private key as the server'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"). | |
| keyManager | back to summary |
|---|---|
| public TlsServerCredentials. Use the provided certificate chain and possibly-encrypted private key as the server'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 be | |
| keyManager | back to summary |
|---|---|
| public TlsServerCredentials. Have the provided key manager select the server'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 implements | |
| requireFakeFeature | back to summary |
|---|---|
| public TlsServerCredentials. Requires | |
| trustManager | back to summary |
|---|---|
| public TlsServerCredentials. Use the provided root certificates to verify the client'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). | |
| trustManager | back to summary |
|---|---|
| public TlsServerCredentials. Use the provided root certificates to verify the client'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). | |
| trustManager | back to summary |
|---|---|
| public TlsServerCredentials. Have the provided trust manager verify the client'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 implements | |
| Modifier and Type | Field and Description |
|---|---|
| public static final TlsServerCredentials. | NONE
Clients will not present any identity. |
| public static final TlsServerCredentials. | OPTIONAL
Clients are requested to present their identity, but clients without identities are permitted. |
| public static final TlsServerCredentials. | REQUIRE
Clients are requested to present their identity, and are required to provide a valid identity. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static TlsServerCredentials. | |
| public static TlsServerCredentials. |
| NONE | back to summary |
|---|---|
| public static final TlsServerCredentials. Clients will not present any identity. | |
| OPTIONAL | back to summary |
|---|---|
| public static final TlsServerCredentials. Clients are requested to present their identity, but clients without identities are permitted. | |
| REQUIRE | back to summary |
|---|---|
| public static final TlsServerCredentials. Clients are requested to present their identity, and are required to provide a valid identity. | |
| ClientAuth | back to summary |
|---|---|
| private ClientAuth() | |
| valueOf | back to summary |
|---|---|
| public static TlsServerCredentials. | |
| values | back to summary |
|---|---|
| public static TlsServerCredentials. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final TlsServerCredentials. | CUSTOM_MANAGERS
Key managers and trust managers may be specified as |
| public static final TlsServerCredentials. | FAKE
A feature that no consumer should understand. |
| public static final TlsServerCredentials. | MTLS
Client certificates may be requested and verified. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static TlsServerCredentials. | |
| public static TlsServerCredentials. |
| CUSTOM_MANAGERS | back to summary |
|---|---|
| public static final TlsServerCredentials. Key managers and trust managers may be specified as If other manager sources are available (e.g., | |
| FAKE | back to summary |
|---|---|
| public static final TlsServerCredentials. A feature that no consumer should understand. It should be used for unit testing to confirm
a call to | |
| MTLS | back to summary |
|---|---|
| public static final TlsServerCredentials. Client certificates may be requested and verified. This feature requires observing | |
| Feature | back to summary |
|---|---|
| private Feature() | |
| valueOf | back to summary |
|---|---|
| public static TlsServerCredentials. | |
| values | back to summary |
|---|---|
| public static TlsServerCredentials. | |