Interface X509Identity
- All Superinterfaces:
Destroyable
- All Known Implementing Classes:
StaticX509Identity
Represents a cryptographic identity using a private key and certificate.
-
Method Summary
Modifier and TypeMethodDescriptiondefault SSLContextdefault SSLContextcreateSSLContext(X509TrustManager trustManager) Creates anSSLContextfrom this identity using a specific trust manager.default SSLContextcreateSSLContext(X509TrustManager trustManager, SecureRandom secureRandom) Creates anSSLContextfrom this identity using a specific trust manager and source of randomness.static StringgenerateAlias(Certificate certificate) Generates a certificate alias string.Returns the certificate chain for this identity.Returns the private key and certificate for this identity.Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
Method Details
-
getPrivateCredential
X500PrivateCredential getPrivateCredential()Returns the private key and certificate for this identity. -
getCertificateChain
X509Certificate[] getCertificateChain()Returns the certificate chain for this identity. -
createSSLContext
- Returns:
- a new SSLContext using this identity for authentication
- Throws:
KeyManagementException- if there is an error initializing the SSLContext
-
createSSLContext
Creates anSSLContextfrom this identity using a specific trust manager.- Parameters:
trustManager- the trust manager to use for validating TLS peers- Returns:
- a new SSLContext using this identity for authentication
- Throws:
KeyManagementException- if there is an error initializing the SSLContext- See Also:
-
createSSLContext
default SSLContext createSSLContext(X509TrustManager trustManager, SecureRandom secureRandom) throws KeyManagementException Creates anSSLContextfrom this identity using a specific trust manager and source of randomness.- Parameters:
trustManager- the trust manager to use for validating TLS peerssecureRandom- the source of randomness to use for generating cryptographic bits- Returns:
- a new SSLContext using this identity for authentication
- Throws:
KeyManagementException- if there is an error initializing the SSLContext
-
generateAlias
Generates a certificate alias string. This alias is computed from an extensible output function (XOF) of the certificate's public key.- Parameters:
certificate- certificate to compute an alias for- Returns:
- the computed alias
-