public class SSLContext extends SSLContextInt
For clients, it is legal to merely create an SSLContext and use it immediately, though it is advisable to set the SSLPolicy.
Since servers must have keying material to operate, all SSLContexts which are to be used for servers must be initialized using loadEAYKeyFile() or loadPKS12KeyFile().
Currently, SSLContext supports only one key at a time and loading a new keyfile overrides any exiting keys/certificates. Future implementations may support multiple keys automatically selected based on the cipherSuite.
policy| Constructor and Description |
|---|
SSLContext() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
destroySession(java.lang.String sessionLookupKey) |
protected COM.claymoresystems.ptls.SSLSessionData |
findSession(java.lang.String key) |
void |
loadDHParams(java.io.InputStream is)
Load a DH parameters structure from disk.
|
void |
loadDHParams(java.lang.String path)
Load the DH parameters structure from a file
|
void |
loadEAYKeyFile(java.io.InputStream is,
java.lang.String passphrase)
Load a subset of SSLeay keyfiles.
|
void |
loadEAYKeyFile(java.lang.String path,
java.lang.String passphrase)
Load a subset of SSLeay keyfiles.
|
void |
loadPKCS12File(java.lang.String path,
java.lang.String passphrase)
Load keying material from the indicated PKCS12/PFX keyfile,
using the passphrase passed in
|
void |
loadRootCertificates(java.io.InputStream is)
Load a list of acceptable roots.
|
void |
loadRootCertificates(java.lang.String path)
Load a list of acceptable roots.
|
void |
saveDHParams(java.lang.String path,
int size,
boolean sophieGermainPrimes)
Save DH parameters to disk, generating them if necessary
|
void |
saveEAYKeyFile(java.lang.String path,
java.lang.String passphrase) |
void |
seedRNG(byte[] seed)
Build new RNG based on the indicated seed, or
update current RNG
|
protected void |
storeSession(java.lang.String key,
COM.claymoresystems.ptls.SSLSessionData sd) |
void |
useRandomnessFile(java.lang.String file,
java.lang.String passphrase)
use the indicated file for randomness
If the file does not exist, it is created.
|
getPolicy, setPolicypublic void seedRNG(byte[] seed)
seed - the seedpublic void useRandomnessFile(java.lang.String file,
java.lang.String passphrase)
throws java.io.IOException,
java.io.FileNotFoundException
useRandomnessFile in class SSLContextIntpath - the file namepassphrase - the passphrase needed to decrypt/verify the keyfilejava.io.IOException - if something goes wrongjava.io.FileNotFoundException - if we're unable to update the filepublic void loadPKCS12File(java.lang.String path,
java.lang.String passphrase)
loadPKCS12File in class SSLContextIntpath - the filename for the keyfilepassphrase - the passphrase needed to decrypt/verify the keyfile
Currently not implementedpublic void loadEAYKeyFile(java.lang.String path,
java.lang.String passphrase)
throws java.io.FileNotFoundException,
java.io.IOException
We assume that the first key is bound to the first group of certificates
We assume that any certificates we find are strictly ordered from the user's certificate to the root.
loadEAYKeyFile in class SSLContextIntpath - the filename for the fielpassphrase - the passphrase needed to decrypt the private keyjava.io.IOException - if the keyfile is badly formattedjava.io.FileNotFoundException - if the keyfile doesn't existpublic void loadEAYKeyFile(java.io.InputStream is,
java.lang.String passphrase)
throws java.io.IOException
We assume that the first key is bound to the first group of certificates
We assume that any certificates we find are strictly ordered from the user's certificate to the root.
loadEAYKeyFile in class SSLContextIntis - the filepassphrase - the passphrase needed to decrypt the private keyjava.io.IOException - if the keyfile is badly formattedjava.io.FileNotFoundException - if the keyfile doesn't existpublic void saveEAYKeyFile(java.lang.String path,
java.lang.String passphrase)
throws java.io.IOException,
java.io.FileNotFoundException
saveEAYKeyFile in class SSLContextIntjava.io.IOExceptionjava.io.FileNotFoundExceptionpublic void loadRootCertificates(java.lang.String path)
throws java.io.FileNotFoundException,
java.io.IOException
Roots are not used for verifying the keys found in the keyfile. They are only used for verifying the certificates of peer entities.
Roots are formatted in SSLeay "PEM" style
loadRootCertificates in class SSLContextIntpath - the filename containing the root listjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic void loadRootCertificates(java.io.InputStream is)
throws java.io.IOException
Roots are not used for verifying the keys found in the keyfile. They are only used for verifying the certificates of peer entities.
Roots are formatted in SSLeay "PEM" style
loadRootCertificates in class SSLContextIntpath - the filename containing the root listjava.io.IOExceptionpublic void loadDHParams(java.lang.String path)
throws java.io.FileNotFoundException,
java.io.IOException
loadDHParams in class SSLContextIntpath - the filejava.io.FileNotFoundExceptionjava.io.IOExceptionpublic void loadDHParams(java.io.InputStream is)
throws java.io.IOException
loadDHParams in class SSLContextIntis - the params filejava.io.IOExceptionpublic void saveDHParams(java.lang.String path,
int size,
boolean sophieGermainPrimes)
throws java.io.IOException,
java.io.FileNotFoundException
saveDHParams in class SSLContextIntpath - the file to save tosophieGermainPrimes - generate sophieGermainPrimes (VERY slow)java.io.IOExceptionjava.io.FileNotFoundExceptionprotected void storeSession(java.lang.String key,
COM.claymoresystems.ptls.SSLSessionData sd)
protected COM.claymoresystems.ptls.SSLSessionData findSession(java.lang.String key)
protected void destroySession(java.lang.String sessionLookupKey)
Copyright (c) 1999-2001 Claymore Systems, Inc., All Rights Reserved.