Unigine.SSLSocket Class
Inherits from: | Socket |
SSLSocket Class
Перечисления (Enums)
SSL_HANDSHAKE#
SSL_CTX_METHOD#
LOADER_TYPE#
Имя | Описание |
---|---|
RSA_KEY = 3 | RSA key. |
X509_CERT = 1 | Self-signed X.509 certificate. |
X509_CACERT = 2 | X.509 certificate issued by a Certification Agency. |
Properties
bool IsAvailable#
The value indicating if the socket is available (has been established, but not opened).
bool IsCertificateVerified#
The value indicating if SSL certificate for the socket is successfully verified.
Members
SSLSocket ( ) #
Constructor. Creates a new SSL socket with default parameters (TLS).SSLSocket ( Socket.SOCKET_TYPE socket_type, SSLSocket.SSL_CTX_METHOD ssl_method ) #
Constructor. Creates a new SSL socket with the specified parameters.Arguments
- Socket.SOCKET_TYPE socket_type - SSL socket type.
- SSLSocket.SSL_CTX_METHOD ssl_method - SSL connection method to be used.
void Close ( ) #
Closes the socket.bool Accept ( Socket socket ) #
Accepts a connection on the socket.Arguments
- Socket socket - Socket that is bound to an address and listens to connections.
Return value
true if the connection is accepted; otherwise, fals.bool Connect ( ) #
Initiates a connection on the socket.Return value
true if the connection is initialized; otherwise, false.bool Load ( SSLSocket.LOADER_TYPE loader_type, string path ) #
Loads a certificate from the file.Arguments
- SSLSocket.LOADER_TYPE loader_type - Certificate type, one of the LOADER_TYPE values.
- string path - Path to a certificate file.
Return value
true if the certificate is loaded successfully, otherwise false.bool Parse ( SSLSocket.LOADER_TYPE loader_type, string data ) #
Parses a specified certificate.Arguments
- SSLSocket.LOADER_TYPE loader_type - Certificate type, one of the LOADER_TYPE values.
- string data - Certificate data.
Return value
true if the certificate is parsed successfully, otherwise false.SSLSocket.SSL_HANDSHAKE Handshake ( ) #
Starts a handshake and returns the result.Return value
Handshake status.int Pending ( ) #
Returns the number of bytes available for immediate retrieval without reading from the socket object. This function is essential if you work with event loops.Return value
Number of bytes.uint Read ( IntPtr ptr, uint size, uint nmemb ) #
Reads the specified number of blocks of the specified size from the SSL connection to the specified destination buffer.Arguments
- IntPtr ptr - Pointer to the destination buffer to which the data is to be read.
- uint size - Size of a message block in bytes.
- uint nmemb - Number of message blocks to read from the SSL connection.
Return value
Number of bytes actually read.uint Write ( IntPtr ptr, uint size, uint nmemb ) #
Writes the specified number of blocks of the specified size from the specified source buffer to the SSL connection.Arguments
- IntPtr ptr - Pointer to the source buffer from which the data is to be written.
- uint size - Size of a message block in bytes.
- uint nmemb - Number of message blocks to be written to the SSL connection.
Return value
Number of bytes actually written.uint Peek ( IntPtr ptr, uint size, uint nmemb ) #
Reads the specified number of blocks of the specified size from the SSL connection to the specified destination buffer. This method is identical to Read() except no bytes are actually removed from the underlying BIO during the read, so that a subsequent call to Read() will yield at least the same bytes.Arguments
- IntPtr ptr - Pointer to the destination buffer to which the data is to be read.
- uint size - Size of a message block in bytes.
- uint nmemb - Number of message blocks to be written to the SSL connection.
Return value
Number of bytes actually written.Last update:
13.12.2024
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter