Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Wildcard Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
TLS/SSL Source Code
 previous   up   next 

Function Summary
file
openTlsSocket (inout file: sock)
Return a connected TLS socket file based on the given sock.
file
openTlsSocket (in string: hostName, in integer: portNumber)
Return a connected TLS socket file at a port at hostName.
file
openServerTls (inout file: sock, in array string: certList, in rsaKey: privateKey)
Return a connected TLS socket file based on the given sock.
file
openServerTls (inout file: sock, in certAndKey: certificate)
Return a connected TLS socket file based on the given sock.
void
close (inout tlsFile: aFile)
Close a tlsFile.
boolean
eof (in tlsFile: inFile)
Determine the end-of-file indicator.
void
write (inout tlsFile: outFile, in string: stri)
Write a string to a tlsFile.
void
writeln (inout tlsFile: outFile, in string: stri)
Write a string followed by end-of-line to outSocket.
string
gets (inout tlsFile: inFile, in integer: maxLength)
Read a string with a maximum length from a tlsFile.
string
getln (inout tlsFile: inFile)
Read a line from a tlsFile.

Function Detail

openTlsSocket

const func file: openTlsSocket (inout file: sock)

Return a connected TLS socket file based on the given sock.

Parameters:
sock - A connected internet socket file (client side).
Returns:
an open TLS socket file, or STD_NULL if it could not be opened.
Raises:
MEMORY_ERROR - An out of memory situation occurred.

openTlsSocket

const func file: openTlsSocket (in string: hostName, in integer: portNumber)

Return a connected TLS socket file at a port at hostName. Here hostName is either a host name (e.g.: "www.example.org"), or an IPv4 address in standard dot notation (e.g.: "192.0.2.235"). Operating systems supporting IPv6 may also accept an IPv6 address in colon notation.

Returns:
an open TLS socket file, or STD_NULL if it could not be opened.
Raises:
MEMORY_ERROR - An out of memory situation occurred.

openServerTls

const func file: openServerTls (inout file: sock, in array string: certList, in rsaKey: privateKey)

Return a connected TLS socket file based on the given sock.

Parameters:
sock - A connected internet socket file (server side).
certList - List of server certificates
privateKey - Private key of the first certificate.
Returns:
an open TLS socket file, or STD_NULL if it could not be opened.
Raises:
MEMORY_ERROR - An out of memory situation occurred.

openServerTls

const func file: openServerTls (inout file: sock, in certAndKey: certificate)

Return a connected TLS socket file based on the given sock.

Parameters:
sock - A connected internet socket file (server side).
sock - Server socket (returned by accept).
certificate - Server certificate and corresponding private key.
Returns:
an open TLS socket file, or STD_NULL if it could not be opened.
Raises:
MEMORY_ERROR - An out of memory situation occurred.

close

const proc: close (inout tlsFile: aFile)

Close a tlsFile.

Raises:
FILE_ERROR - A system function returns an error.

eof

const func boolean: eof (in tlsFile: inFile)

Determine the end-of-file indicator. The end-of-file indicator is set when at least one request to read from the socket failed. The socket functions getc, gets, getln and getwd indicate the end-of-file situation by setting bufferChar to EOF.

Returns:
TRUE if the end-of-file indicator is set, FALSE otherwise.

write

const proc: write (inout tlsFile: outFile, in string: stri)

Write a string to a tlsFile.

Raises:
FILE_ERROR - A system function returns an error.
RANGE_ERROR - The string contains a character that does not fit into a byte.

writeln

const proc: writeln (inout tlsFile: outFile, in string: stri)

Write a string followed by end-of-line to outSocket. This function assures that string and '\n' are sent together.


gets

const func string: gets (inout tlsFile: inFile, in integer: maxLength)

Read a string with a maximum length from a tlsFile.

Returns:
the string read.
Raises:
RANGE_ERROR - The length is negative.
MEMORY_ERROR - Not enough memory to represent the result.

getln

const func string: getln (inout tlsFile: inFile)

Read a line from a tlsFile. The function accepts lines ending with '\n', "\r\n" or EOF. The line ending characters are not copied into the string. That means that the '\r' of a "\r\n" sequence is silently removed. When the function is left inFile.bufferChar contains '\n' or EOF.

Returns:
the line read.
Raises:
MEMORY_ERROR - Not enough memory to represent the result.


 previous   up   next