Class Cipher

    Definition

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

    Provides the methods for encrypting and decrypting data.

    public class Cipher
    Inheritance
    object
    Cipher

    Constructors

    View Source

    Cipher(CipherParameters)

    Initializes an instance of Cipher class with CipherParameters.

    Declaration
    public Cipher(CipherParameters parameters)
    Parameters
    Type Name Description
    CipherParameters parameters

    Algorithm specific parameters.

    Properties

    View Source

    Parameters

    Gets algorithm specific parameters.

    Declaration
    public CipherParameters Parameters { get; }
    Property Value
    Type Description
    CipherParameters

    Algorithm specific parameters.

    Methods

    View Source

    Decrypt(string, string, byte[])

    Decrypts data using selected key and the algorithm.

    Declaration
    public byte[] Decrypt(string keyAlias, string password, byte[] cipherText)
    Parameters
    Type Name Description
    string keyAlias

    Alias of the key to be used for decryption.

    string password

    Password used in decrypting a key value.

    byte[] cipherText

    Data to be decrypted.

    Returns
    Type Description
    byte[]

    Decrypted data.

    Remarks

    Key type specified by keyAlias should be compatible with the algorithm specified in Parameters.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when keyAlias or cipherText is null.

    System.ArgumentException

    Thrown when mandatory algorithm parameter is missing or invalid. Thrown when optional algorithm parameter is invalid.

    System.InvalidOperationException

    Thrown when key-protecting password does not match. Thrown when key does not exist with given keyAlias.

    View Source

    Encrypt(string, string, byte[])

    Encrypts data using selected key and algorithm.

    Declaration
    public byte[] Encrypt(string keyAlias, string password, byte[] plainText)
    Parameters
    Type Name Description
    string keyAlias

    Alias of the key to be used for encryption.

    string password

    Password used in decrypting a key value.

    byte[] plainText

    Data to be encrypted.

    Returns
    Type Description
    byte[]

    Encrypted data.

    Remarks

    Key type specified by the keyAlias should be compatible with the algorithm specified in Parameters.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when keyAlias or plainText is null.

    System.ArgumentException

    Thrown when mandatory algorithm parameter is missing or invalid. Thrown when optional algorithm parameter is invalid.

    System.InvalidOperationException

    Thrown when key-protecting password does not match. Thrown when key does not exist with given keyAlias.

    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX