Class SecureArrayCall
Call used by SecureArray to secure the array.
Inheritance
Inherited Members
Namespace: Isopoh.Cryptography.SecureArray
Assembly: Isopoh.Cryptography.SecureArray.dll
Syntax
public class SecureArrayCall
Constructors
| Edit this page View SourceSecureArrayCall(Action<IntPtr, nuint>, Func<IntPtr, nuint, string?>, Action<IntPtr, nuint>, string)
Initializes a new instance of the SecureArrayCall class.
Declaration
public SecureArrayCall(Action<IntPtr, nuint> zeroMemory, Func<IntPtr, nuint, string?> lockMemory, Action<IntPtr, nuint> unlockMemory, string os)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<IntPtr, nuint> | zeroMemory | Call that zeroes memory in a way that does not get optimized away. |
| Func<IntPtr, nuint, string> | lockMemory | Call that locks the given memory, so it doesn't get swapped out to disk. |
| Action<IntPtr, nuint> | unlockMemory | Call that unlocks memory previously locked by a call to |
| string | os | The name of the operating system this SecureArrayCall is for. |
SecureArrayCall(Action<IntPtr, nuint>, Func<IntPtr, nuint, string?>, Action<IntPtr, nuint>, string, bool)
Initializes a new instance of the SecureArrayCall class.
Declaration
public SecureArrayCall(Action<IntPtr, nuint> zeroMemory, Func<IntPtr, nuint, string?> lockMemory, Action<IntPtr, nuint> unlockMemory, string os, bool isMemoryLockSupported)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<IntPtr, nuint> | zeroMemory | Call that reliably zeroes memory. |
| Func<IntPtr, nuint, string> | lockMemory | Call that locks memory into RAM. |
| Action<IntPtr, nuint> | unlockMemory | Call that unlocks memory. |
| string | os | The operating system these calls support. |
| bool | isMemoryLockSupported | Whether this environment can prevent a buffer from being swapped to disk. |
Properties
| Edit this page View SourceIsMemoryLockSupported
Gets a value indicating whether this environment can prevent buffers from being swapped to disk.
Declaration
public bool IsMemoryLockSupported { get; }
Property Value
| Type | Description |
|---|---|
| bool |
LockMemory
Gets or sets a method that locks the given memory, so it doesn't get swapped out to disk.
Declaration
public Func<IntPtr, nuint, string?> LockMemory { get; protected set; }
Property Value
| Type | Description |
|---|---|
| Func<IntPtr, nuint, string> | Null on success; otherwise an error message. |
Os
Gets or sets the operating system this SecureArrayCall works for.
Declaration
public string Os { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
UnlockMemory
Gets or sets a method that unlocks memory previously locked by a call to LockMemory.
Declaration
public Action<IntPtr, nuint> UnlockMemory { get; protected set; }
Property Value
| Type | Description |
|---|---|
| Action<IntPtr, nuint> |
ZeroMemory
Gets or sets a method that zeroes memory in a way that does not get optimized away.
Declaration
public Action<IntPtr, nuint> ZeroMemory { get; protected set; }
Property Value
| Type | Description |
|---|---|
| Action<IntPtr, nuint> |
Remarks
On Linux, OSX, and UWP, simply calls memset() and hopes the P/Invoke mechanism does not have special handling for memset calls (and thus does not even think about optimizing the call away).