Show / Hide Table of Contents

Class SecureArrayCall

Call used by SecureArray to secure the array.

Inheritance
object
SecureArrayCall
DefaultLinuxSecureArrayCall
DefaultOsxSecureArrayCall
DefaultUwpSecureArrayCall
DefaultWebSecureArrayCall
DefaultWindowsSecureArrayCall
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Isopoh.Cryptography.SecureArray
Assembly: Isopoh.Cryptography.SecureArray.dll
Syntax
public class SecureArrayCall

Constructors

| Edit this page View Source

SecureArrayCall(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 lockMemory.

string os

The name of the operating system this SecureArrayCall is for.

| Edit this page View Source

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 Source

IsMemoryLockSupported

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
| Edit this page View Source

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.

| Edit this page View Source

Os

Gets or sets the operating system this SecureArrayCall works for.

Declaration
public string Os { get; set; }
Property Value
Type Description
string
| Edit this page View Source

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>
| Edit this page View Source

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).

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX