Class KeyManager

    Definition

    Namespace:
    Tizen.Security.SecureRepository
    Assembly:
    Tizen.Security.SecureRepository.dll

    This class provides the methods for storing, retrieving, and creating keys.

    public class KeyManager : Manager
    Inheritance
    object
    Manager
    KeyManager

    Methods

    View Source

    CreateAesKey(int, string, Policy)

    Creates the AES key and stores it inside the secure repository based on each policy.

    Declaration
    public static void CreateAesKey(int size, string keyAlias, Policy policy)
    Parameters
    Type Name Description
    int size

    The size of the key strength to be created. 128, 192 and 256 are supported.

    string keyAlias

    The name of key to be stored.

    Policy policy

    The policy about how to store the key securely.

    Remarks

    If the password in policy is provided, the key is additionally encrypted with the password in policy.

    View Source

    CreateDsaKeyPair(int, string, string, Policy, Policy)

    Creates the DSA private/public key pair and stores them inside the secure repository based on each policy.

    Declaration
    public static void CreateDsaKeyPair(int size, string privateKeyAlias, string publicKeyAlias, Policy privateKeyPolicy, Policy publicKeyPolicy)
    Parameters
    Type Name Description
    int size

    The size of key strength to be created. 1024, 2048, 3072, and 4096 are supported.

    string privateKeyAlias

    The name of private key to be stored.

    string publicKeyAlias

    The name of public key to be stored.

    Policy privateKeyPolicy

    The policy about how to store a private key securely.

    Policy publicKeyPolicy

    The policy about how to store a public key securely.

    Remarks

    If the password in policy is provided, the key is additionally encrypted with the password in policy.

    View Source

    CreateEcdsaKeyPair(EllipticCurveType, string, string, Policy, Policy)

    Creates the ECDSA private/public key pair and stores them inside secure repository based on each policy.

    Declaration
    public static void CreateEcdsaKeyPair(EllipticCurveType type, string privateKeyAlias, string publicKeyAlias, Policy privateKeyPolicy, Policy publicKeyPolicy)
    Parameters
    Type Name Description
    EllipticCurveType type

    The type of elliptic curve of ECDSA.

    string privateKeyAlias

    The name of private key to be stored.

    string publicKeyAlias

    The name of public key to be stored.

    Policy privateKeyPolicy

    The policy about how to store a private key securely.

    Policy publicKeyPolicy

    The policy about how to store a public key securely.

    Remarks

    If the password in policy is provided, the key is additionally encrypted with the password in policy.

    View Source

    CreateRsaKeyPair(int, string, string, Policy, Policy)

    Creates the RSA private/public key pair and stores them inside the secure repository based on each policy.

    Declaration
    public static void CreateRsaKeyPair(int size, string privateKeyAlias, string publicKeyAlias, Policy privateKeyPolicy, Policy publicKeyPolicy)
    Parameters
    Type Name Description
    int size

    The size of key strength to be created. 1024, 2048, and 4096 are supported.

    string privateKeyAlias

    The name of private key to be stored.

    string publicKeyAlias

    The name of public key to be stored.

    Policy privateKeyPolicy

    The policy about how to store a private key securely.

    Policy publicKeyPolicy

    The policy about how to store a public key securely.

    Remarks

    If the password in policy is provided, the key is additionally encrypted with the password in policy.

    View Source

    Get(string, string)

    Gets a key from the secure repository.

    Declaration
    public static Key Get(string alias, string password)
    Parameters
    Type Name Description
    string alias

    The name of a key to retrieve.

    string password

    The password used in decrypting a key value. If password of policy is provided in SaveKey(), the same password should be provided.

    Returns
    Type Description
    Key

    A key specified by alias.

    View Source

    GetAliases()

    Gets all aliases of keys, which the client can access.

    Declaration
    public static IEnumerable<string> GetAliases()
    Returns
    Type Description
    IEnumerable<><string>

    All aliases of keys, which the client can access.

    View Source

    Save(string, Key, Policy)

    Stores a key inside the secure repository based on the provided policy.

    Declaration
    public static void Save(string alias, Key key, Policy policy)
    Parameters
    Type Name Description
    string alias

    The name of a key to be stored.

    Key key

    The key's binary value to be stored.

    Policy policy

    The policy about how to store a key securely.

    Remarks

    The type in key may be set to KeyType.None as an input. The type is determined inside the secure reposioty during storing keys.

    Extension Methods

    EXamlExtensions.LoadFromEXaml<T>(T, string)
    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    EXamlExtensions.LoadFromEXamlPath<TXaml>(TXaml, string)
    EXamlExtensions.LoadFromEXamlPath<T>(T, Type)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX