Skip to content

libsodium.SKI.SecretStream.Read

Andrew Lambert edited this page Nov 26, 2022 · 4 revisions

Method Signatures

 Function Read(Count As Integer, encoding As TextEncoding = Nil) As String Implements Readable.Read
 Function Read(Count As Integer, AdditionalData As MemoryBlock) As String

Parameters

Read(Integer, TextEncoding) As String

Name Type Comment
Count Integer The number of encrypted bytes to read.
Encoding TextEncoding Optional. If specified, the encoding of the decrypted data.

Read(Integer, MemoryBlock) As String

Name Type Comment
Count Integer The number of encrypted bytes to read.
AdditionalData MemoryBlock Additional data that was used to compute the authentication code.

Return value

The decrypted bytes, or an empty string on error.

Remarks

This method reads an encrypted message, decrypts it, and verifies the included message authentication code. If AdditionalData was used by the encryptor when generating the authentication code then the AdditionalData must be supplied to this method (See: AEAD).

Clone this wiki locally