Skip to content

libsodium.KeyStream.Constructor

Andrew Lambert edited this page Jan 21, 2023 · 10 revisions

libsodium.KeyStream.Constructor

Method Signatures

 Sub Constructor(NewStreamType As libsodium.StreamType = libsodium.StreamType.XSalsa20)
 Sub Constructor(FromPassword As libsodium.Password, Optional Salt As MemoryBlock, Limits As libsodium.ResourceLimits = libsodium.ResourceLimits.Interactive, HashAlgorithm As Int32 = libsodium.Password.ALG_ARGON2, NewStreamType As libsodium.StreamType = libsodium.StreamType.XSalsa20)
 Sub Constructor(KeyData As libsodium.PKI.PublicKey, NewStreamType As libsodium.StreamType = libsodium.StreamType.XSalsa20)

Parameters

Constructor(libsodium.StreamType)

Name Type Comment
NewStreamType StreamType Optional. The cipher to use. If not specified then XSalsa20 is used.

Constructor(libsodium.Password, MemoryBlock, libsodium.ResourceLimits, Int32, libsodium.StreamType)

Name Type Comment
FromPassword Password The password from which to derive a key.
Salt MemoryBlock Optional. A random salt for the key derivation algorithm.
Limits ResourceLimits Optional. A member of the ResourceLimits enumeration.
HashAlgorithm Int32 Optional. The key derivation algorithm to use (ALG_ARGON2 or ALG_SCRYPT).
NewStreamType StreamType Optional. The cipher to use. If not specified then XSalsa20 is used.

Constructor(libsodium.PKI.PublicKey, libsodium.StreamType)

Name Type Comment
KeyData PublicKey The public half of an encryption or signing key pair to use as the key.
NewStreamType StreamType Optional. The cipher to use. If not specified then XSalsa20 is used.

Remarks

Generates a new random key stream, or derives one from a password or from the public half of a key pair.

If libsodium is not available at runtime, a PlatformNotSupportedException will be raised.

Clone this wiki locally