Modifier and Type | Field and Description |
---|---|
static java.lang.String |
toSign |
Modifier | Constructor and Description |
---|---|
protected |
SSLCTX(int options,
int num_sessions)
Establish a new client/server context.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Remove a client/server context.
|
protected void |
finalize() |
SSL |
find(Socket s)
Find an ssl object based on a Socket reference.
|
SSL |
newClient(Socket socket,
byte[] session_id) |
SSL |
newServer(Socket socket) |
int |
objLoad(int obj_type,
byte[] data,
int len,
java.lang.String password)
Load security material (CA, Cert or private key) in binary DER or ASCII PEM format.
|
int |
objLoad(int obj_type,
Stream material,
java.lang.String password)
Load security material (CA, Cert or private key) in binary DER or ASCII PEM format.
|
public static final java.lang.String toSign
protected SSLCTX(int options, int num_sessions) throws NoSuchAlgorithmException
options
- [in] Any particular options. At present the options
supported are:
- SSL_SERVER_VERIFY_LATER (client only): Don't stop a handshake if the
server authentication fails. The certificate can be authenticated
later with a call to verifyCert().
- SSL_CLIENT_AUTHENTICATION (server only): Enforce client authentication
i.e. each handshake will include a "certificate request" message
from the server.
- SSL_NO_DEFAULT_KEY: Don't use the default key/certificate. The user
will load the key/certificate explicitly.
- SSL_DISPLAY_BYTES (full mode build only): Display the byte sequences
during the handshake.
- SSL_DISPLAY_STATES (full mode build only): Display the state changes
during the handshake.
- SSL_DISPLAY_CERTS (full mode build only): Display the certificates that
are passed during a handshake.
- SSL_DISPLAY_RSA (full mode build only): Display the RSA key details
that are passed during a handshake.num_sessions
- [in] The number of sessions to be used for session
caching. If this value is 0, then there is no session caching.
If this option is null, then the default internal private key/
certificate pair is used (if CONFIG_SSL_USE_DEFAULT_KEY is set).
The resources used by this object are automatically freed.NoSuchAlgorithmException
public final void dispose()
public final SSL find(Socket s)
s
- [in] A reference to a totalcross.net.Socket object.public final int objLoad(int obj_type, Stream material, java.lang.String password) throws IOException, NoSuchAlgorithmException, CryptoException
obj_type
- [in] The format of the file. Can be one of:
- SSL_OBJ_X509_CERT (no password required).
- SSL_OBJ_X509_CACERT (no password required).
- SSL_OBJ_RSA_KEY (AES128/AES256 PEM encryption supported). (not supported on Desktop)
- SSL_OBJ_P8 (RC4-128 encrypted data supported). (password protection not supported on Desktop)
- SSL_OBJ_P12 (RC4-128 encrypted data supported).
PEM encoded files are automatically detected and may contain several material,
whereas DER encoding only support one single material.material
- [in] security material input stream.password
- [in] The password used. Can be null if not required.CryptoException
NoSuchAlgorithmException
IOException
public final int objLoad(int obj_type, byte[] data, int len, java.lang.String password) throws NoSuchAlgorithmException, CryptoException
obj_type
- [in] The format of the memory data.
- SSL_OBJ_X509_CERT (no password required).
- SSL_OBJ_X509_CACERT (no password required).
- SSL_OBJ_RSA_KEY (AES128/AES256 PEM encryption supported). (not supported on Desktop)
- SSL_OBJ_P8 (RC4-128 encrypted data supported). (password protection not supported on Desktop)
- SSL_OBJ_P12 (RC4-128 encrypted data supported).
PEM encoded data is automatically detected and may contain several material,
whereas DER encoding only support one single material.data
- [in] The binary data to be loaded.len
- [in] The amount of data to be loaded.password
- [in] The password used. Can be null if not required.CryptoException
NoSuchAlgorithmException
public final SSL newClient(Socket socket, byte[] session_id) throws IOException, NoSuchAlgorithmException, CryptoException
public final SSL newServer(Socket socket) throws IOException, NoSuchAlgorithmException, CryptoException
protected final void finalize()
finalize
in class java.lang.Object