Zilog EZ80F91AZA Manual do Utilizador Página 67

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 79
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 66
UM020107-1211 Creating SSL Applications
ZTP Network Security SSL Plug-In
User Manual
61
This API opens the SSL socket (SSL) and requests an SSL connection to port 0x1234
on the remote device on which the IP address is 172.16.6.204. If the SSL session is
successfully established,
socketfd will reference the SSL device driver ID dedicated
to this connection. If an SSL session cannot be established,
connect() returns a neg-
ative value.
2. To receive TCP data over the TCP-SSL connection, the
recv API is used. For exam-
ple, to receive 10 bytes of TCP data and place the data in a buffer called
MyBuff, the
following code fragment can be used:
BYTE MyBuff[100];
INT16 Status;
Status = recv( sockfd, MyBuf, 10, 0);
The exact same API is used to receive 10 bytes of data through the SSL layer.
Although the data sent between the client and server SSL layers is encrypted, the data
passed between the ZTP SSL layer and user application is nonencrypted. Therefore, the
code that retrieves data from the ZTP TCP layer can also be used to retrieve decrypted data
from the ZTP SSL layer without modification.
To send TCP data, the
send API is used. For example, to send 10 bytes of TCP data
from a buffer called
MyBuff, the following code fragment can be used:
Status = send( ConnectionDev, MyBuf, 10, 0);
This exact same API is also be used to send 10 bytes through the SSL layer.
3. To close an underlying TCP/SSL connection, the
close_s() API is used with the
socket of the connection (used during the data transfer) that is passed as a parameter.
close_s( sockfd );
The exact same close_s API is also used to close the SSL session represented by the
SSL connection socket.
In summary, any ZTP TCP client application is converted to use SSL for secure data
transfer by changing the socket type used from
SOCK_STREAM to SOCK_SSL. The syn-
tax and semantics of all other data transfer APIs are identical for both TCP and SSL.
For more information about the TCP socket layer APIs, refer to the API Definitions chap-
ter of the ZTP Network Security SSL Plug-In Reference Manual (RM0047)
.
Note:
Vista de página 66
1 2 ... 62 63 64 65 66 67 68 69 70 71 72 ... 78 79

Comentários a estes Manuais

Sem comentários