public class OpenSSLContext extends Object implements SSLContext
Modifier and Type | Field and Description |
---|---|
protected long |
ctx |
Constructor and Description |
---|
OpenSSLContext(SSLHostConfig sslHostConfig,
SSLHostConfigCertificate certificate,
List<String> negotiableProtocols) |
Modifier and Type | Method and Description |
---|---|
SSLEngine |
createSSLEngine() |
protected void |
finalize() |
protected static PKCS8EncodedKeySpec |
generateKeySpec(char[] password,
byte[] key)
Generates a key specification for an (encrypted) private key.
|
List<String> |
getCiphers() |
String |
getEnabledProtocol() |
SSLSessionContext |
getServerSessionContext() |
SSLServerSocketFactory |
getServerSocketFactory() |
SSLParameters |
getSupportedSSLParameters() |
void |
init(KeyManager[] kms,
TrustManager[] tms,
SecureRandom sr)
Setup the SSL_CTX
|
void |
setEnabledProtocol(String protocol) |
public OpenSSLContext(SSLHostConfig sslHostConfig, SSLHostConfigCertificate certificate, List<String> negotiableProtocols) throws SSLException
SSLException
public String getEnabledProtocol()
public void setEnabledProtocol(String protocol)
public void init(KeyManager[] kms, TrustManager[] tms, SecureRandom sr)
init
in interface SSLContext
kms
- Must contain a KeyManager of the type
OpenSSLKeyManager
tms
- sr
- Is not used for this implementation.public SSLSessionContext getServerSessionContext()
getServerSessionContext
in interface SSLContext
public SSLEngine createSSLEngine()
createSSLEngine
in interface SSLContext
public SSLServerSocketFactory getServerSocketFactory()
getServerSocketFactory
in interface SSLContext
public SSLParameters getSupportedSSLParameters()
getSupportedSSLParameters
in interface SSLContext
protected static PKCS8EncodedKeySpec generateKeySpec(char[] password, byte[] key) throws IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeySpecException, InvalidKeyException, InvalidAlgorithmParameterException
password
- characters, if null
or empty an unencrypted key
is assumedkey
- bytes of the DER encoded private keyIOException
- if parsing key
failsNoSuchAlgorithmException
- if the algorithm used to encrypt
key
is unknownNoSuchPaddingException
- if the padding scheme specified in the
decryption algorithm is unknownInvalidKeySpecException
- if the decryption key based on
password
cannot be generatedInvalidKeyException
- if the decryption key based on
password
cannot be used to decrypt key
InvalidAlgorithmParameterException
- if decryption algorithm
parameters are somehow faultyCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.