Interface TLSContext
access this type via: net.TLSContext (provides, requires or uses)
This API represents a context entity for a TLS session. The configuration parameters of a session are set here, and passed into a session when instantiating it.
Constants
byte CLIENT
byte SERVER
int CIPHER_DEFAULT
int CIPHER_ALL
Functions
TLSContext(byte mode)
bool setCertificate(char cert[], byte key[])
bool setCertificateChain(String chain[])
void setCipherSet(int mode)
Constants
CLIENT Configure this context for use in client mode.
SERVER Configure this context for use in server mode.
CIPHER_DEFAULT Use the default cipher set of the library (a good balance between compatibility and security).
CIPHER_ALL Use all ciphers available in the library (maximise compatibility).
TLSContext(byte mode)
Create a new context object, specifying whether this is for a server or client mode.
bool setCertificate(char cert[], byte key[])
Set the certificate and private key to be used by this node. The certificate should be supplied in a base64-encoded PEM format, and they key is assumed to be RSA encoded in PKCS1 format.
bool setCertificateChain(String chain[])
Set the certificate chain to be used by this node. The certificate chain is a list of base64-encoded PEM certificates.
void setCipherSet(int mode)
Configure the cipher set to tbe used by this node for encryption (both nodes involved in a channel must have at least one available cipher in common).