Class SecureBuffer
This class is used for storing passwords and other security-sensitive tokens. Stores a verbatim byte buffer which is formed by Push(byte). Once buffer is formed, it gets sealed via Seal() to obtain its content. The Dispose()/Forget() methods invalidate the secure data in-place, leaving no copies in memory.
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Azos.Security
Assembly: Azos.dll
Syntax
[SlimSerializationProhibited]
public sealed class SecureBuffer : DisposableObject, IDisposable
Constructors
SecureBuffer(Int32)
Declaration
public SecureBuffer(int capacity = 32)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | capacity |
Properties
Content
Returns the buffer content. The buffer must be sealed
Declaration
public byte[] Content { get; }
Property Value
Type | Description |
---|---|
System.Byte[] |
IsSealed
Declaration
public bool IsSealed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Destructor()
Declaration
protected override void Destructor()
Overrides
Forget()
Erases the buffer content in-place
Declaration
public void Forget()
Push(Byte)
Adds a byte to the buffer. The buffer must not be sealed
Declaration
public void Push(byte b)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | b |
Seal()
Seals the buffer to prevent modifications. The buffer must not be sealed before this call
Declaration
public void Seal()
Implements
System.IDisposable