Connectivity Software User's Guide and Reference
CreateSalt Method



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.Security.User Namespace > MemoryNameAndPasswordUserManager Class : CreateSalt Method
Creates a cryptographically random salt for password hashing.
Syntax
'Declaration
 
<JetBrains.Annotations.NotNullAttribute()>
Protected Overridable Function CreateSalt() As Byte()
'Usage
 
Dim instance As MemoryNameAndPasswordUserManager
Dim value() As Byte
 
value = instance.CreateSalt()
[JetBrains.Annotations.NotNull()]
protected virtual byte[] CreateSalt()
[JetBrains.Annotations.NotNull()]
protected:
virtual array<byte>^ CreateSalt(); 

Return Value

A byte array containing the generated salt.

This method never returns null (Nothing in Visual Basic).

Remarks

This method or property does not throw any exceptions, aside from execution exceptions such as System.Threading.ThreadAbortException or System.OutOfMemoryException.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also