ContentsIndex
PreviousUpNext
SSL & TLS
Topics | Functions | Structs, Records, Enums | Types
Description

This API provides ability to create secure sockets.

Introduction

This module provides SSL APIs for security connection, the implementation is based on xySSL. 

The basic flow of using SSL APIs is as follows:

  1. Configure the context, which contains host address and callback to register.
  2. Connect to the host using vm_ssl_connect(context).
  3. Handle the VM_SSL_EVENT_CONNECTED in the registered callback.
  4. Use vm_ssl_read()to read or vm_ssl_write() to write data after the security connection is established, and VM_SSL_EVENT_CAN_WRITE and VM_SSL_EVENT_CAN_READ has arrived.
  5. Close the connection by calling vm_ssl_close().
Limitation

The platform doesn't have preloaded certificate agency certificate, so when connecting to a server and you've set verify type VM_SSL_VERIFY_REQUIRED, you will also need to set the certificate agency certificate of the website you want to connect by calling vm_ssl_load_ca_chain_certificate() after vm_ssl_connect().

Group
Functions
Function 
Description 
This utility function decodes a buffer with base64 encoding. Call this function with *destination_length = 0 to obtain the required buffer size in *destination_length. 
This utility function encodes a buffer with base64 encoding. Call this function with *destination_length = 0 to obtain the required buffer size in *destination_length. 
Closes the connection. 
Creates SSL connection to remote host. 
Get the verify result. 
Load certificate agency certificate in X.509 formate (.cer files) 
read data from ssl connection. 
This utility function hashes input buffer using the HMAC algorithm and the SHA-1 hash function to a 160 bits (20-bytes) hash value. 
write data from ssl connection. 
Structs, Records, Enums
Struct, Record, Enum 
Description 
SSL configuration context 
Error values for connection related APIs, e.g. vm_ssl_read and vm_ssl_write
Events passing to vm_ssl_connection_callback
Error values for vm_ssl_get_verify_result
Verification type used for socket connection. 
Types
Type 
Description 
Callback function for connection events. This is configured in vm_ssl_context_t
Handle to a SSL connection. 
Links
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.