Class KeyManager

    Definition

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

    Provides methods for storing, retrieving, and creating keys.

    public class KeyManager : Manager
    Inheritance
    object
    Manager
    KeyManager

    Methods

    View Source

    CreateAesKey(int, string, Policy)

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

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

    Size of the key strength to be created.

    string keyAlias

    The name of key to be stored.

    Policy policy

    Key storing policy.

    Remarks

    128, 192 and 256 sizes are supported.

    View Source

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

    Creates 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

    Size of key strength to be created.

    string privateKeyAlias

    Name of a private key to be stored.

    string publicKeyAlias

    Name of a public key to be stored.

    Policy privateKeyPolicy

    Private key storing policy.

    Policy publicKeyPolicy

    Public key storing policy.

    Remarks

    1024, 2048, 3072, and 4096 sizes are supported.

    View Source

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

    Creates 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

    Type of elliptic curve of ECDSA.

    string privateKeyAlias

    Name of private key to be stored.

    string publicKeyAlias

    Name of public key to be stored.

    Policy privateKeyPolicy

    Private key storing policy.

    Policy publicKeyPolicy

    Public key storing policy.

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

    Size of key strength to be created.

    string privateKeyAlias

    Name of a private key to be stored.

    string publicKeyAlias

    Name of a public key to be stored.

    Policy privateKeyPolicy

    Private key storing policy.

    Policy publicKeyPolicy

    Public key storing policy.

    Remarks

    1024, 2048, and 4096 sizes are supported.

    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

    Name of a key to retrieve.

    string password

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

    Returns
    Type Description
    Key

    Key specified by alias.

    View Source

    GetAliases()

    Gets all aliases of keys accessible by the client.

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

    All aliases of keys accessible by the client.

    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

    Name of a key to be stored.

    Key key

    Key's binary value to be stored.

    Policy policy

    Key storing policy.

    Remarks

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

    Extension Methods

    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    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