Aether Utilities Aether Utilities
Aether Utilities Aether Utilities
DocFX + Singulink = ♥

Search Results for

    Edit this page

    Class KeyManager

    Namespace
    AetherUtils.Core.Licensing
    Assembly
    AetherUtils.Core.dll
    Handles loading and saving private and public keys to file system.
    [UsedImplicitly]
    public static class KeyManager
    Inheritance
    object
    KeyManager
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()

    Methods

    CreateKeys(string)

    Create a new public and private key pair using the specified passphrase.
    [UsedImplicitly]
    public static KeyPair CreateKeys(string passphrase)

    Parameters

    passphrase string
    The passphrase used to derive the key pair.

    Returns

    KeyPair
    A new KeyPair containing a public and private key.

    LoadAllKeys(IEnumerable<string>)

    Loads all key pairs specified by the list of full paths.
    [UsedImplicitly]
    public static List<KeyPair> LoadAllKeys(IEnumerable<string> paths)

    Parameters

    paths IEnumerable<string>
    A list of full file paths to key files.

    Returns

    List<KeyPair>
    A list of KeyPairs loaded from the file paths. This list is in the same order as the paths.

    LoadKeys(string)

    Load a key pair from a file.
    [UsedImplicitly]
    public static KeyPair? LoadKeys(string fullPath)

    Parameters

    fullPath string
    The full, absolute path to a key file.

    Returns

    KeyPair
    A KeyPair representing the key values or null if the file was not valid.

    Exceptions

    ArgumentException
    If fullPath was null or empty.

    LoadKeys(string, string)

    Load a key pair from a file.
    [UsedImplicitly]
    public static KeyPair? LoadKeys(string basePath, string fileName)

    Parameters

    basePath string
    The base folder the keys are located in.
    fileName string
    The name of the file to load.

    Returns

    KeyPair
    A KeyPair representing the key values.

    Exceptions

    ArgumentException
    If basePath was null or empty.
    ArgumentException
    If fileName was null or empty.

    SaveAllKeys(IEnumerable<Pair<string, KeyPair>>)

    Save all the key pair files specified in the list to disk. Each pair in the list should be in this format:
    Full Path, Key Pair
    [UsedImplicitly]
    public static void SaveAllKeys(IEnumerable<Pair<string, KeyPair>> pathsAndKeys)

    Parameters

    pathsAndKeys IEnumerable<Pair<string, KeyPair>>
    A list of paths and KeyPair objects to save.

    SaveKeys(KeyPair, string)

    Save the full key pair to a file.
    [UsedImplicitly]
    public static void SaveKeys(KeyPair keys, string fullPath)

    Parameters

    keys KeyPair
    The pair of keys (public and private). Public key should be first.
    fullPath string
    The full path of the file to save.

    Exceptions

    ArgumentException
    If fullPath was null or empty.
    ArgumentException
    If keys was null.

    SaveKeys(KeyPair, string, string)

    Save the full key pair to a file.
    [UsedImplicitly]
    public static void SaveKeys(KeyPair keys, string basePath, string fileName)

    Parameters

    keys KeyPair
    The pair of keys (public and private). Public key should be first.
    basePath string
    The base folder to save the keys in.
    fileName string
    The name of the file to save: recommended is keyPair.keys

    Exceptions

    ArgumentException
    If basePath was null or empty.
    ArgumentException
    If fileName was null or empty.
    ArgumentException
    If keys was null.

    SavePublicKey(string, string)

    Save only the public key to a file.
    [UsedImplicitly]
    public static void SavePublicKey(string publicKey, string fullPath)

    Parameters

    publicKey string
    The public key to save.
    fullPath string
    The full path of the file to save.

    Exceptions

    ArgumentException
    If fullPath was null or empty.
    ArgumentException
    If publicKey was null or empty.

    SavePublicKey(string, string, string)

    Save only the public key to a file.
    [UsedImplicitly]
    public static void SavePublicKey(string publicKey, string basePath, string fileName)

    Parameters

    publicKey string
    The public key to save.
    basePath string
    The base folder to save the public key in.
    fileName string
    The name of the file to save: recommended is public.key

    Exceptions

    ArgumentException
    If basePath was null or empty.
    ArgumentException
    If fileName was null or empty.
    ArgumentException
    If publicKey was null or empty.
    (c) 2024 Ethan Hann. All rights reserved.