SuB.LibSSL: Types Modinfo Source  

Secure Socket Layer

libSSL Blitzmax Module by Sub_Zero v1.0

You need libssl-dev installed for linux
On windows you need the libssleay32.dll and libeay32.dll included in the same folder for compiled executables to work as expected
You can find them in the ssl/lib folder of this module.

Types Summary

SSL_CTX SSL Context.


DescriptionSSL Context.
Methods Summary
Accept Accept incoming SSL connection.
Bind Bind a SSL socket.
CAFile Set a Certificate Authority file.
CAVerify Verify the Certificate Authority File.
Close Close And free the SSL_CTX.
Context Set a SSL_CTX context.
Create Creates a new SSL_CTX.
GetFileTimeWin Get windows file times.
Init Initialize SSL Library.
ReadBytes ReadBytes ssl.
ReadString ReadString ssl.
RecieveFile RecieveFile ssl.
SendFile SendFile ssl.
SetCertFile Set the Certificate file.
SetCertPassword Set the Certificate password.
SetFileTime Set time of a file.
SetKeyFile Set the key file.
Shutdown Shut down ssl connection.
SSLConnect Connect to SSL Socket.
WriteBytes WriteBytes ssl.
WriteString WriteString ssl.
Method Accept:Int()
ReturnsTrue if successful, false if unsuccessful.
DescriptionAccept incoming SSL connection.
InformationListens and accepts incoming SSL connections.
Method Bind:Int(port:Int)
ReturnsTrue on success, false if unsuccessful.
DescriptionBind a SSL socket.
InformationBind a SSL Socket to a given port.
Method CAFile:Int(file:String, path:String = Null)
ReturnsTrue on success, false if unsuccessfull.
DescriptionSet a Certificate Authority file.
InformationLets you set CACERT file for verifying certificates.
Method CAVerify:Long()
ReturnsTrue on success, false if unsuccessful.
DescriptionVerify the Certificate Authority File.
InformationVerifies the CACERT you have set for verifying certificates.
Method Close()
DescriptionClose And free the SSL_CTX.
Method Context(server:Int = False, encryption:Int = TLSv1_2_client_method)
DescriptionSet a SSL_CTX context.
InformationLets you set a context with a SSL_METHOD function
Available functions:
SSLv23_client_method (Negotiate highest SSL/TLS encryption (default))
SSLv23_server_method (Negotiate highest SSL/TLS encryption (default))
DTLS_client_method (DTLS v1.0 AND DTLS v1.2)
DTLS_server_method (DTLS v1.0 AND DTLS v1.2)
Method Create:SSL_CTX()
ReturnsSSL_CTX Type.
DescriptionCreates a new SSL_CTX.
InformationThis Method is called when you create a new SSL Context.
Method GetFileTimeWin:Byte Ptr(path:String)
ReturnsWindows file times as 3 longs in a row (byte ptr)
DescriptionGet windows file times.
InformationGet the windows file times (access/write/creation)
Method Init()
DescriptionInitialize SSL Library.
InformationThis Method has to be called before setting a context.
Method ReadBytes:Byte[](size:Int = 0)
ReturnsAn array of bytes.
DescriptionReadBytes ssl.
InformationReads an array of bytes from a ssl connection.
Method ReadString:String()
ReturnsString read from ssl connection.
DescriptionReadString ssl.
InformationRead a string from ssl connection.
Method RecieveFile:Int(fname:String, size:Long, path:String = "")
ReturnsTrue if successful, false if unsuccessful.
DescriptionRecieveFile ssl.
InformationRecieve a file from ssl connection.
Method SendFile:Int(fname:String, path:String = "")
ReturnsTrue if successful, false if unsuccessful.
DescriptionSendFile ssl.
InformationSend a file to ssl connection.
Method SetCertFile:Int(file:String, ftype:Int = X509_FILETYPE_PEM)
ReturnsTrue on success, false if unsuccessful.
DescriptionSet the Certificate file.
InformationSets the Certificate file with a certificate type function
Available certificate types:
default: X509_FILETYPE_PEM
Method SetCertPassword:Int(pwd:String)
DescriptionSet the Certificate password.
InformationSets the password for your certificate.
Method SetFileTime:Int(path:String, time:Int, stime:Byte Ptr)
ReturnsTrue if successful, false if unsuccessful.
DescriptionSet time of a file.
InformationSets the filetime of a file (time=linux/unix, stime=win)
Method SetKeyFile:Int(file:String, ftype:Int = X509_FILETYPE_PEM)
ReturnsTrue on success, false if unsuccessful.
DescriptionSet the key file.
InformationSets the Certificate key file with a certificate type function.
Method Shutdown:Int()
ReturnsTrue if successful, false if unsuccessful.
DescriptionShut down ssl connection.
InformationShuts down the ssl connection and closes the associated used socket(s)
Method SSLConnect:Int(host:String, port:Int)
ReturnsTrue on success, false if unsuccessful.
DescriptionConnect to SSL Socket.
InformationConnect to a SSL Socket using hostname/ip and port.
Method WriteBytes:Int(data:Byte[])
ReturnsTrue if successful, false if unsuccessful.
DescriptionWriteBytes ssl.
InformationWrite an array of bytes to a ssl connection.
Method WriteString:Int(str:String)
ReturnsTrue if successful, false if unsuccessful.
DescriptionWriteString ssl.
InformationWrite a string to ssl connection.

Module Information

CopyrightWrapper by Sub_Zero