axTLS
axTLSj.SSL Class Reference

A representation of an SSL connection. More...

Public Member Functions

 SSL (int ip)
 Store the reference to an SSL context. More...
 
void dispose ()
 Free any used resources on this connection. More...
 
int handshakeStatus ()
 Return the result of a handshake. More...
 
byte getCipherId ()
 Return the SSL cipher id. More...
 
byte[] getSessionId ()
 Get the session id for a handshake. More...
 
String getCertificateDN (int component)
 Retrieve an X.509 distinguished name component. More...
 

Data Fields

int m_ssl
 

Detailed Description

A representation of an SSL connection.

Constructor & Destructor Documentation

axTLSj.SSL.SSL ( int  ip)
inline

Store the reference to an SSL context.

Parameters
ip[in] A reference to an SSL object.

References axTLSj.SSL.m_ssl.

Member Function Documentation

void axTLSj.SSL.dispose ( )
inline

Free any used resources on this connection.

A "Close Notify" message is sent on this connection (if possible). It is up to the application to close the socket.

References axTLSj.SSL.m_ssl.

int axTLSj.SSL.handshakeStatus ( )
inline

Return the result of a handshake.

Returns
SSL_OK if the handshake is complete and ok.
See Also
ssl.h for the error code list.

References axTLSj.SSL.m_ssl.

byte axTLSj.SSL.getCipherId ( )
inline

Return the SSL cipher id.

Returns
The cipher id which is one of:
  • SSL_AES128_SHA (0x2f)
  • SSL_AES256_SHA (0x35)
  • SSL_RC4_128_SHA (0x05)
  • SSL_RC4_128_MD5 (0x04)

References axTLSj.SSL.m_ssl.

byte [] axTLSj.SSL.getSessionId ( )
inline

Get the session id for a handshake.

This will be a 32 byte sequence and is available after the first handshaking messages are sent.

Returns
The session id as a 32 byte sequence.
Note
A SSLv23 handshake may have only 16 valid bytes.

References axTLSj.SSL.m_ssl.

String axTLSj.SSL.getCertificateDN ( int  component)
inline

Retrieve an X.509 distinguished name component.

When a handshake is complete and a certificate has been exchanged, then the details of the remote certificate can be retrieved.

This will usually be used by a client to check that the server's common name matches the URL.

A full handshake needs to occur for this call to work.

Parameters
component[in] one of:
  • SSL_X509_CERT_COMMON_NAME
  • SSL_X509_CERT_ORGANIZATION
  • SSL_X509_CERT_ORGANIZATIONAL_NAME
  • SSL_X509_CA_CERT_COMMON_NAME
  • SSL_X509_CA_CERT_ORGANIZATION
  • SSL_X509_CA_CERT_ORGANIZATIONAL_NAME
Returns
The appropriate string (or null if not defined)

References axTLSj.SSL.m_ssl.

Field Documentation

Copyright © 2007 Cameron Rich