public final class SslContextBuilder extends Object
The crypto performed by this class is relatively slow. Clients should reuse SSL context instances where possible.
| Constructor and Description |
|---|
SslContextBuilder(String hostName) |
| Modifier and Type | Method and Description |
|---|---|
SSLContext |
build() |
KeyPair |
generateKeyPair() |
static SSLContext |
localhost()
Returns a new SSL context for this host's current localhost address.
|
X509Certificate |
selfSignedCertificate(KeyPair keyPair,
String serialNumber)
Generates a certificate for
hostName containing keyPair's
public key, signed by keyPair's private key. |
public SslContextBuilder(String hostName)
hostName - the subject of the host. For TLS this should be the
domain name that the client uses to identify the server.public static SSLContext localhost()
public SSLContext build() throws GeneralSecurityException
GeneralSecurityExceptionpublic KeyPair generateKeyPair() throws GeneralSecurityException
GeneralSecurityExceptionpublic X509Certificate selfSignedCertificate(KeyPair keyPair, String serialNumber) throws GeneralSecurityException
hostName containing keyPair's
public key, signed by keyPair's private key.GeneralSecurityExceptionCopyright © 2016. All Rights Reserved.