namespace Tizen.Security.SecureRepository
{
/// <summary>
- /// The class that represents a certificate.
+ /// Represents a certificate.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class Certificate
/// Loads Certificate from the given file path.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="filePath">The path of certificate file to be loaded.</param>
+ /// <param name="filePath">Path of certificate file to be loaded.</param>
/// <returns>Loaded certificate class instance.</returns>
- /// <exception cref="ArgumentNullException">
- /// The filePath should not be null
- /// </exception>
+ /// <exception cref="ArgumentNullException">Thrown when <paramref name="filePath"/> is null.</exception>
/// <exception cref="InvalidOperationException">
- /// Invalid certificate file format. Provided file path does not exist or
- /// cannot be accessed.
+ /// Thrown when a certificate has invalid file format.
+ /// Thrown when provided file path does not exist or cannot be accessed.
/// </exception>
static public Certificate Load(string filePath)
{
}
/// <summary>
- /// A constructor of Certificate that takes the binary and its format.
+ /// Initializes an instance of Certificate class with a binary and its data format.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="binary">The binary data of a certificate.</param>
- /// <param name="format">The format of the binary data.</param>
+ /// <param name="binary">Binary data of a certificate.</param>
+ /// <param name="format">Format of the binary data.</param>
public Certificate(byte[] binary, DataFormat format)
{
this.Binary = binary;
}
/// <summary>
- /// The binary value of a certificate.
+ /// Gets and sets binary value of a certificate.
/// </summary>
+ /// <value>
+ /// Binary value of a certificate.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public byte[] Binary
{
}
/// <summary>
- /// The format of the binary value.
+ /// Gets and sets format of the binary value.
/// </summary>
+ /// <value>
+ /// Format of the binary value.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public DataFormat Format
{
namespace Tizen.Security.SecureRepository
{
/// <summary>
- /// This class provides the methods handling certificates.
+ /// Provides methods that handle certificates.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class CertificateManager : Manager
/// Gets a certificate from the secure repository.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="alias">The name of a certificate to be retrieved.</param>
- /// <param name="password">
- /// The password used in decrypting a certificate value. If password of
- /// policy is provided in SaveCertificate(), the same password should be
- /// provided.
- /// </param>
- /// <returns>A certificate specified by alias.</returns>
+ /// <remarks>
+ /// If password of policy is provided in SaveCertificate(),
+ /// the same password should be provided.
+ /// </remarks>
+ /// <param name="alias">Name of a certificate to be retrieved.</param>
+ /// <param name="password">Password used in decrypting a certificate value.</param>
+ /// <returns>Certificate specified by alias.</returns>
/// <exception cref="ArgumentNullException">
- /// The alias argument is null.
+ /// Thrown when <paramref name="alias"/> argument is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// The alias argument is in an invalid format.
+ /// Thrown when <paramref name="alias"/> argument has an invalid format.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// The certificate does not exist with the alias or certificate-protecting
- /// password isn't matched.
+ /// Thrown when a certificate does not exist with the <paramref name="alias"/> or certificate-protecting
+ /// password does not match.
/// </exception>
static public Certificate Get(string alias, string password)
{
}
/// <summary>
- /// Gets all aliases of certificates, which the client can access.
+ /// Gets all aliases of certificates accessible by the client.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <returns>All aliases of certificates, which the client can access.</returns>
- /// <exception cref="ArgumentException">No alias to get.</exception>
+ /// <returns>All aliases of certificates accessible by the client.</returns>
+ /// <exception cref="ArgumentException">Thrown when there's no alias to get.</exception>
static public IEnumerable<string> GetAliases()
{
IntPtr ptr = IntPtr.Zero;
/// Stores a certificate inside the secure repository based on the provided policy.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="alias">The name of a certificate to be stored.</param>
- /// <param name="cert">The certificate's binary value to be stored.</param>
- /// <param name="policy">
- /// The policy about how to store a certificate securely.
- /// </param>
- /// <exception cref="ArgumentNullException">
- /// Any of argument is null.
- /// </exception>
+ /// <param name="alias">Name of a certificate to be stored.</param>
+ /// <param name="cert">Certificate's binary value to be stored.</param>
+ /// <param name="policy">Certificate storing policy.</param>
+ /// <exception cref="ArgumentNullException">Thrown when any argument is null.</exception>
/// <exception cref="ArgumentException">
- /// The alias argument is in the invalid format. cert argument is in the invalid format.
+ /// Thrown when <paramref name="alias"/> or <paramref name="cert"/> argument has an invalid format.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// The certificate with alias already exist.
+ /// Thrown when a certificate with given <paramref name="alias"/> already exists.
/// </exception>
static public void Save(string alias, Certificate cert, Policy policy)
{
/// Verifies a certificate chain and returns that chain.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="certificate">The certificate to be verified.</param>
+ /// <remarks>
+ /// Trusted root certificate of the chain should exist in the system's
+ /// certificate storage.
+ /// </remarks>
+ /// <remarks>
+ /// Trusted root certificate of the chain in the system's certificate storage
+ /// is added to the certificate chain.
+ /// </remarks>
+ /// <param name="certificate">Certificate to be verified.</param>
/// <param name="untrustedCertificates">
- /// The untrusted CA certificates to be used in verifying a certificate chain.
+ /// Untrusted CA certificates to be used in verifying a certificate chain.
/// </param>
- /// <returns>A newly created certificate chain.</returns>
+ /// <returns>Newly created certificate chain.</returns>
/// <exception cref="ArgumentNullException">
- /// The certificate argument is null.
+ /// Thrown when a <paramref name="certificate"/> argument is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// Some of the certificates in arguments are invalid.
- /// </exception>
+ /// Thrown when any of the provided certificates is invalid.</exception>
/// <exception cref="InvalidOperationException">
- /// Some of the certificates in arguments are expired or not valid yet.
- /// Certificate cannot build chain.
- /// The root certificate is not in the trusted system certificate store.
+ /// Thrown when any of the provided certificates is expired or not valid yet.
+ /// Thrown when certificate cannot build a chain.
+ /// Thrown when root certificate is not in the trusted system certificate store.
/// </exception>
- /// <remarks>
- /// The trusted root certificate of the chain should exist in the system's
- /// certificate storage.
- /// </remarks>
- /// <remarks>
- /// The trusted root certificate of the chain in the system's certificate storage
- /// is added to the certificate chain.
- /// </remarks>
static public IEnumerable<Certificate> GetCertificateChain(
Certificate certificate, IEnumerable<Certificate> untrustedCertificates)
{
/// trusted and untrusted CA certificates.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="certificate">The certificate to be verified.</param>
+ /// <remarks>
+ /// Trusted root certificate of the chain in the system's certificate storage
+ /// is added to the certificate chain.
+ /// </remarks>
+ /// <param name="certificate">Certificate to be verified.</param>
/// <param name="untrustedCertificates">
- /// The untrusted CA certificates to be used in verifying a certificate chain.
+ /// Untrusted CA certificates to be used in verifying a certificate chain.
/// </param>
/// <param name="trustedCertificates">
- /// The trusted CA certificates to be used in verifying a certificate chain.
+ /// Trusted CA certificates to be used in verifying a certificate chain.
/// </param>
/// <param name="useTrustedSystemCertificates">
- /// The flag indicating the use of the trusted root certificates in the
+ /// Flag indicating the use of the trusted root certificates in the
/// system's certificate storage.
/// </param>
- /// <returns>A newly created certificate chain.</returns>
+ /// <returns>Newly created certificate chain.</returns>
/// <exception cref="ArgumentNullException">
- /// The certificate argument is null.
+ /// Thrown when <paramref name="certificate"/> argument is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// Some of the certificates in arguments are invalid.
+ /// Thrown when any of the provided certificates is invalid.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Some of the certificates in arguments are expired or not valid yet.
- /// Certificate cannot build chain.
- /// The root certificate is not in the trusted system certificate store.
+ /// Thrown when any of the provided certificates is expired or not valid yet.
+ /// Thrown when certificate cannot build a chain.
+ /// Thrown when root certificate is not in the trusted system certificate store.
/// </exception>
- /// <remarks>
- /// The trusted root certificate of the chain in the system's certificate storage
- /// is added to the certificate chain.
- /// </remarks>
static public IEnumerable<Certificate> GetCertificateChain(
Certificate certificate, IEnumerable<Certificate> untrustedCertificates,
IEnumerable<Certificate> trustedCertificates,
}
/// <summary>
- /// Perform OCSP, which checks whether the certificate is revoked or not.
+ /// [Obsolete("Please do not use! this will be deprecated")]
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="certificateChain">
- /// Valid certificate chain to perform the OCSP check.
- /// </param>
- /// <returns>A status result of the OCSP check.</returns>
+ /// <param name="certificateChain">Valid certificate chain to perform the OCSP check.</param>
+ /// <returns>Status result of the OCSP check.</returns>
/// <exception cref="ArgumentNullException">
- /// The certificateChain argument is null.
+ /// Thrown when <paramref name="certificateChain"/> argument is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// The certificateChain is not valid chain or certificate.
+ /// Thrown when <paramref name="certificateChain"/> is not a valid chain or certificate.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Some of the certificates in chain are expired or not valid yet.
+ /// Thrown when any of the certificates in chain is expired or not valid yet.
/// </exception>
[Obsolete("Please do not use! This will be deprecated with API9 and removed with API11! Please use raw OpenSSL instead!")]
static public OcspStatus CheckOcsp(IEnumerable<Certificate> certificateChain)
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// A class for holding parameters for the AES algorithm with the CBC mode.
+ /// Holds parameters for the AES algorithm with the CBC mode.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class AesCbcCipherParameters : AesCipherParameters
{
/// <summary>
- /// A default constructor.
+ /// Initializes an instance of AesCbcCipherParameters class.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <remarks>The CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.AesCbc.</remarks>
+ /// <remarks>CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.AesCbc.</remarks>
public AesCbcCipherParameters() : base(CipherAlgorithmType.AesCbc)
{
}
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// A class for holding parameters for the AES algorithm with the CFB mode.
+ /// Holds parameters for the AES algorithm with the CFB mode.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class AesCfbCipherParameters : AesCipherParameters
{
/// <summary>
- /// A default constructor.
+ /// Initializes an instance of AesCfbCipherParameters class.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <remarks>The CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.AesCfb.</remarks>
+ /// <remarks>CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.AesCfb.</remarks>
public AesCfbCipherParameters() : base(CipherAlgorithmType.AesCfb)
{
}
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// An abstract class for holding parameters for the AES algorithm.
+ /// Holds parameters for the AES algorithm.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public abstract class AesCipherParameters : CipherParameters
{
/// <summary>
- /// An initialization vector.
+ /// Gets and sets initialization vector.
/// </summary>
+ /// <value>
+ /// Initialization vector for AES cipher.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public byte[] IV
{
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// A class for holding parameters for the AES algorithm with the counter mode.
+ /// Holds parameters for the AES algorithm with the counter mode.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class AesCtrCipherParameters : AesCipherParameters
{
/// <summary>
- /// A default constructor.
+ /// Initializes an instance of AesCtrCipherParameters class.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <remarks>The CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.AesCtr.</remarks>
+ /// <remarks>CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.AesCtr.</remarks>
public AesCtrCipherParameters() : base(CipherAlgorithmType.AesCtr)
{
}
/// <summary>
- /// Length of the counter block in bits.
+ /// Gets and sets the length of the counter block in bits.
/// </summary>
+ /// <value>
+ /// Length of the counter block in bits. Optional, only 128b is supported at the moment.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
- /// <remarks>Optional, only 128b is supported at the moment.</remarks>
- /// <exception cref="ArgumentOutOfRangeException">The value should be positive.</exception>
+ /// <exception cref="ArgumentOutOfRangeException">Thrown when value is not positive.</exception>
public long CounterLength
{
get
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// A class for holding parameters for the AES algorithm with the GCM mode.
+ /// Holds parameters for the AES algorithm with the GCM mode.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class AesGcmCipherParameters : AesCipherParameters
{
/// <summary>
- /// A default constructor.
+ /// Initializes an instance of AesGcmCipherParameters class.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <remarks>The CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.AesGcm.</remarks>
+ /// <remarks>CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.AesGcm.</remarks>
public AesGcmCipherParameters() : base(CipherAlgorithmType.AesGcm)
{
}
/// <summary>
- /// GCM tag length in bits.
+ /// Gets and sets GCM tag length.
/// </summary>
+ /// <value>
+ /// GCM tag length in bits. One of {32, 64, 96, 104, 112, 120, 128} (optional),
+ /// if not present the length 128 is used.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
- /// <remarks>One of {32, 64, 96, 104, 112, 120, 128} (optional), if not present the length 128 is used.</remarks>
- /// <exception cref="ArgumentOutOfRangeException">TagLength should be one of {32, 64, 96, 104, 112, 120, 128}.</exception>
+ /// <exception cref="ArgumentOutOfRangeException">
+ /// Thrown when TagLength is not one of {32, 64, 96, 104, 112, 120, 128}.
+ /// </exception>
public long TagLength
{
get
}
/// <summary>
- /// Additional authentication data (optional).
+ /// Gets and sets additional authentication data.
/// </summary>
+ /// <value>
+ /// Additional authentication data (optional).
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public byte[] AAD
{
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// This class provides the methods for encrypting and decrypting data.
+ /// Provides the methods for encrypting and decrypting data.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class Cipher
private readonly CipherParameters _parameters;
/// <summary>
- /// A constructor of Cipher that takes the algorithm specific parameters.
+ /// Initializes an instance of Cipher class with CipherParameters.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="parameters">The algorithm specific parameters.</param>
+ /// <param name="parameters">Algorithm specific parameters.</param>
public Cipher(CipherParameters parameters)
{
_parameters = parameters;
}
/// <summary>
- /// The algorithm specific parameters.
+ /// Gets algorithm specific parameters.
/// </summary>
+ /// <value>
+ /// Algorithm specific parameters.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public CipherParameters Parameters
{
}
/// <summary>
- /// Decrypts data using the selected key and the algorithm.
+ /// Decrypts data using selected key and the algorithm.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <remarks>
+ /// Key type specified by keyAlias should be compatible with the algorithm
+ /// specified in Parameters.
+ /// </remarks>
+ /// <remarks>
+ /// If password of policy is provided in SaveKey(), the same password should be provided.
+ /// </remarks>
+ /// <remarks>
+ /// Some algorithms may require additional information embedded in encrypted data.
+ /// AES GCM is an example.
+ /// </remarks>
/// <param name="keyAlias">Alias of the key to be used for decryption.</param>
- /// <param name="password">
- /// The password used in decrypting a key value. If password of policy is
- /// provided in SaveKey(), the same password should be provided.
- /// </param>
- /// <param name="cipherText">
- /// Data to be decrypted (some algorithms may require additional information
- /// embedded in encrypted data.AES GCM is an example).
- /// </param>
+ /// <param name="password">Password used in decrypting a key value.</param>
+ /// <param name="cipherText">Data to be decrypted.</param>
/// <returns>Decrypted data.</returns>
/// <exception cref="ArgumentNullException">
- /// The keyAlias or cipherText is null.
+ /// Thrown when <paramref name="keyAlias"/> or <paramref name="cipherText"/> is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// The mandatory algorithm parameter is missing or invalid.
- /// The optional algorithm parameter is invalid.
+ /// Thrown when mandatory algorithm parameter is missing or invalid.
+ /// Thrown when optional algorithm parameter is invalid.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// The key-protecting password isn't matched.
- /// The key does not exist with the keyAlias.
+ /// Thrown when key-protecting password does not match.
+ /// Thrown when key does not exist with given keyAlias.
/// </exception>
- /// <remarks>
- /// The key type specified by keyAlias should be compatible with the algorithm
- /// specified in Parameters.
- /// </remarks>
public byte[] Decrypt(string keyAlias, string password, byte[] cipherText)
{
if (keyAlias == null || cipherText == null)
/// Encrypts data using selected key and algorithm.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="keyAlias">Alias of the key to be used for encryption.</param>
- /// <param name="password">
- /// The password used in decrypting a key value. If password of policy is
- /// provided in SaveKey(), the same password should be provided.
- /// </param>
- /// <param name="plainText">
- /// Data to be encrypted. In case of the AES algorithm, there are no restrictions on
- /// the size of data. For RSA, the size must be smaller or equal to (key_size_in
+ /// <remarks>
+ /// Key type specified by the keyAlias should be compatible with the algorithm
+ /// specified in Parameters.
+ /// </remarks>
+ /// <remarks>
+ /// If password of policy is provided in SaveKey(), the same password should be provided.
+ /// </remarks>
+ /// <remarks>
+ /// In case of the AES algorithm, there are no restrictions on
+ /// the size of plaintext data. For RSA, the size must be smaller or equal to (key_size_in
/// bytes - 42). Example: For 1024 RSA key, the maximum data size is
/// 1024/8 - 42 = 86.
- /// </param>
+ /// </remarks>
+ /// <param name="keyAlias">Alias of the key to be used for encryption.</param>
+ /// <param name="password">Password used in decrypting a key value.</param>
+ /// <param name="plainText">Data to be encrypted.</param>
/// <returns>Encrypted data.</returns>
/// <exception cref="ArgumentNullException">
- /// The keyAlias or plainText is null.
+ /// Thrown when <paramref name="keyAlias"/> or <paramref name="plainText"/> is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// The mandatory algorithm parameter is missing or invalid.
- /// The optional algorithm parameter is invalid.
+ /// Thrown when mandatory algorithm parameter is missing or invalid.
+ /// Thrown when optional algorithm parameter is invalid.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// The key-protecting password isn't matched.
- /// The key does not exist with the keyAlias.
+ /// Thrown when key-protecting password does not match.
+ /// Thrown when key does not exist with given <paramref name="keyAlias"/>.
/// </exception>
- /// <remarks>
- /// The key type specified by the keyAlias should be compatible with the algorithm
- /// specified in Parameters.
- /// </remarks>
public byte[] Encrypt(string keyAlias, string password, byte[] plainText)
{
if (keyAlias == null || plainText == null)
public enum CipherAlgorithmType : int
{
/// <summary>
- /// The AES-CTR algorithm.
+ /// AES-CTR algorithm.
+ /// </summary>
+ /// <remarks>
/// Supported parameters:
- /// - ParameterName.AlgorithmType = AesCtr(mandatory),
- /// - ParameterName.IV = 16 - byte initialization vector(mandatory)
+ /// - ParameterName.AlgorithmType = AesCtr (mandatory),
+ /// - ParameterName.IV = 16 - byte initialization vector (mandatory)
/// - ParameterName.CounterLength = length of counter block in bits
- /// (optional, only 128b is supported at the moment)
- /// </summary>
+ /// (optional, only 128b is supported at the moment).
+ /// </remarks>
AesCtr = 0x01,
/// <summary>
- /// The AES-CBC algorithm.
- /// Supported parameters:
- /// - ParameterName.AlgorithmType = AesCbc(mandatory),
- /// - ParameterName.IV = 16-byte initialization vector(mandatory)
+ /// AES-CBC algorithm.
/// </summary>
+ /// <remarks>
+ /// Supported parameters:
+ /// - ParameterName.AlgorithmType = AesCbc (mandatory),
+ /// - ParameterName.IV = 16-byte initialization vector (mandatory).
+ /// </remarks>
AesCbc,
/// <summary>
- /// The AES-GCM algorithm.
+ /// AES-GCM algorithm.
+ /// </summary>
+ /// <remarks>
/// Supported parameters:
- /// - ParameterName.AlgorithmType = AesGcm(mandatory),
- /// - ParameterName.IV = initialization vector(mandatory)
+ /// - ParameterName.AlgorithmType = AesGcm (mandatory),
+ /// - ParameterName.IV = initialization vector (mandatory)
/// - ParameterName.TagLength = GCM tag length in bits. One of
- /// {32, 64, 96, 104, 112, 120, 128} (optional, if not present the length 128 is used)
- /// - CKMC_PARAM_ED_AAD = additional authentication data(optional)
- /// </summary>
+ /// {32, 64, 96, 104, 112, 120, 128} (optional, if not present the length of 128 is used)
+ /// - CKMC_PARAM_ED_AAD = additional authentication data (optional).
+ /// </remarks>
AesGcm,
/// <summary>
- /// Th AES-CFB algorithm.
- /// Supported parameters:
- /// - ParameterName.AlgorithmType = AesCfb(mandatory),
- /// - ParameterName.IV = 16-byte initialization vector(mandatory)
+ /// AES-CFB algorithm.
/// </summary>
+ /// <remarks>
+ /// Supported parameters:
+ /// - ParameterName.AlgorithmType = AesCfb (mandatory),
+ /// - ParameterName.IV = 16-byte initialization vector (mandatory).
+ /// </remarks>
AesCfb,
/// <summary>
- /// The RSA-OAEP algorithm.
+ /// RSA-OAEP algorithm.
+ /// </summary>
+ /// <remarks>
/// Supported parameters:
- /// - ParameterName.AlgorithmType = RsaOaep(required),
+ /// - ParameterName.AlgorithmType = RsaOaep (mandatory),
/// - ParameterName.Label = label to be associated with the message
- /// (optional, not supported at the moment)
- /// </summary>
+ /// (optional, not supported at the moment).
+ /// </remarks>
RsaOaep
}
}
public enum CipherParameterName : int
{
/// <summary>
- /// The Algorithm Type.
+ /// Algorithm Type.
/// </summary>
AlgorithmType = 0x01,
/// <summary>
- /// Initial Vector, 16B buffer (up to 2^64-1 bytes long in case of AES GCM).
+ /// Initial Vector.
/// </summary>
+ /// <remarks>
+ /// 16B buffer (up to 2^64-1 bytes long in case of AES GCM).
+ /// </remarks>
IV = 101,
/// <summary>
/// Integer - ctr length in bits.
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// An abstract class for holding parameters for encryption and decryption.
+ /// Holds parameters for encryption and decryption.
/// </summary>
/// <since_tizen> 3 </since_tizen>
abstract public class CipherParameters
private SafeCipherParametersHandle _handle;
/// <summary>
- /// The Cipher algorithm type.
+ /// Gets cipher algorithm type.
/// </summary>
+ /// <value>
+ /// Cipher algorithm type.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public CipherAlgorithmType Algorithm
{
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// A class for holding parameters for the DSA signature algorithm.
+ /// Holds parameters for the DSA signature algorithm.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class DsaSignatureParameters : SignatureParameters
{
/// <summary>
- /// A default constructor.
+ /// Initializes an instance of DsaSignatureParameters class.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public DsaSignatureParameters() : base(SignatureAlgorithmType.Dsa)
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// A class for holding parameters for the ECDSA signature algorithm.
+ /// Holds parameters for the ECDSA signature algorithm.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class EcdsaSignatureParameters : SignatureParameters
{
/// <summary>
- /// A default constructor.
+ /// Initializes an instance of EcdsaSignatureParameters class.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public EcdsaSignatureParameters() : base(SignatureAlgorithmType.Ecdsa)
public enum HashAlgorithm : int
{
/// <summary>
- /// The no hash algorithm.
+ /// No hash algorithm.
/// </summary>
None = 0,
/// <summary>
- /// The hash algorithm SHA1.
+ /// SHA1 hash algorithm.
/// </summary>
Sha1,
/// <summary>
- /// The hash algorithm SHA256.
+ /// SHA256 hash algorithm.
/// </summary>
Sha256,
/// <summary>
- /// The hash algorithm SHA384.
+ /// SHA384 hash algorithm.
/// </summary>
Sha384,
/// <summary>
- /// The hash algorithm SHA512.
+ /// SHA512 hash algorithm.
/// </summary>
Sha512
}
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// A class for holding parameters for the RSA algorithm with the OAEP mode.
+ /// Holds parameters for the RSA algorithm with the OAEP mode.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class RsaOaepCipherParameters : CipherParameters
{
/// <summary>
- /// A default constructor.
+ /// Initializes an instance of RsaOaepCipherParameters class.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <remarks>The CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.RsaOaep.</remarks>
+ /// <remarks>CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.RsaOaep.</remarks>
public RsaOaepCipherParameters() : base(CipherAlgorithmType.RsaOaep)
{
}
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// A class for holding parameters for the RSA signature algorithm.
+ /// Holds parameters for the RSA signature algorithm.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class RsaSignatureParameters : SignatureParameters
{
/// <summary>
- /// A default constructor.
+ /// Initializes an instance of RsaSignatureParameters class.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <remarks>The RsaPadding is set to RsaPaddingAlgorithm.None.</remarks>
}
/// <summary>
- /// The RSA padding algorithm.
+ /// Gets and sets RSA padding algorithm.
/// </summary>
+ /// <value>
+ /// RSA padding algorithm type.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public RsaPaddingAlgorithm RsaPadding
{
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// This class provides the methods for creating and verifying a signature.
+ /// Provides the methods for creating and verifying a signature.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class Signature
private SignatureParameters _parameters;
/// <summary>
- /// A constructor of Signature that takes the algorithm specific parameters.
+ /// Initializes an instance of Signature class with SignatureParameters.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="parameters">The algorithm specific parameters.</param>
}
/// <summary>
- /// The algorithm specific parameters.
+ /// Gets algorithm specific parameters.
/// </summary>
+ /// <value>
+ /// Algorithm specific parameters.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public SignatureParameters Parameters
{
/// the signature.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="privateKeyAlias">The name of private key.</param>
+ /// <remarks>
+ /// Key type specified by the privateKeyAlias should be compatible with the
+ /// algorithm specified in Parameters.
+ /// </remarks>
+ /// <remarks>
+ /// If the password of policy is provided during storing a key, the same password
+ /// should be provided.
+ /// </remarks>
+ /// <param name="privateKeyAlias">Name of a private key.</param>
/// <param name="password">
- /// The password used in decrypting a private key value.
+ /// Password used in decrypting a private key value.
/// </param>
- /// <param name="message">The message that is signed with a private key.</param>
- /// <returns>A newly created signature.</returns>
+ /// <param name="message">Message signed with a private key.</param>
+ /// <returns>Newly created signature.</returns>
/// <exception cref="ArgumentNullException">
- /// The privateKeyAlias or message is null.
+ /// Thrown when <paramref name="privateKeyAlias"/> or <paramref name="message"/> is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// The privateKeyAlias is invalid format.
+ /// Thrown when <paramref name="privateKeyAlias"/> has invalid format.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// The key-protecting password isn't matched.
- /// The key does not exist with the privateKeyAlias.
+ /// Thrown when key-protecting password does not match.
+ /// Thrown when key does not exist with given <paramref name="privateKeyAlias"/>.
/// </exception>
- /// <remarks>
- /// The key type specified by the privateKeyAlias should be compatible with the
- /// algorithm specified in Parameters.
- /// </remarks>
- /// <remarks>
- /// If the password of policy is provided during storing a key, the same password
- /// should be provided.
- /// </remarks>
public byte[] Sign(string privateKeyAlias, string password, byte[] message)
{
if (privateKeyAlias == null || message == null)
/// the signature status.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="publicKeyAlias">The name of public key.</param>
+ /// <remarks>
+ /// Key type specified by publicKeyAlias should be compatible with the
+ /// algorithm specified in Parameters.
+ /// </remarks>
+ /// <remarks>
+ /// If password of policy is provided during storing a key, the same password
+ /// should be provided.
+ /// </remarks>
+ /// <param name="publicKeyAlias">Name of a public key.</param>
/// <param name="password">
- /// The password used in decrypting a public key value.
+ /// Password used in decrypting a public key value.
/// </param>
- /// <param name="message">The input on which the signature is created.</param>
- /// <param name="signature">The signature that is verified with public key.</param>
+ /// <param name="message">Input message on which the signature is created.</param>
+ /// <param name="signature">Signature that is verified with public key.</param>
/// <returns>
- /// The signature status. True is returned when the signature is valid.
+ /// Signature status. True if the signature is valid.
/// </returns>
/// <exception cref="ArgumentNullException">
- /// The publicKeyAlias, message or signature is null.
+ /// Thrown when <paramref name="publicKeyAlias"/>, <paramref name="message"/>
+ /// or <paramref name="signature"/> is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// The publicKeyAlias is invalid format.
+ /// Thrown when <paramref name="publicKeyAlias"/> has invalid format.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// The key-protecting password isn't matched.
- /// The key does not exist with the publicKeyAlias.
+ /// Thrown when key-protecting password does not match.
+ /// Thrown when key does not exist with given <paramref name="publicKeyAlias"/>.
/// </exception>
- /// <remarks>
- /// The key type specified by publicKeyAlias should be compatible with the
- /// algorithm specified in Parameters.
- /// </remarks>
- /// <remarks>
- /// If password of policy is provided during storing a key, the same password
- /// should be provided.
- /// </remarks>
public bool Verify(
string publicKeyAlias, string password, byte[] message, byte[] signature)
{
public enum SignatureAlgorithmType : int
{
/// <summary>
- /// The RSA signature algorithm.
+ /// RSA signature algorithm.
/// </summary>
Rsa = 0x01,
/// <summary>
- /// The DSA signature algorithm.
+ /// DSA signature algorithm.
/// </summary>
Dsa,
/// <summary>
- /// The ECDSA signature algorithm.
+ /// ECDSA signature algorithm.
/// </summary>
Ecdsa
}
internal enum SignatureParameterName : int
{
/// <summary>
- /// The signature algorithm type.
+ /// Signature algorithm type.
/// </summary>
AlgorithmType = 0x01,
/// <summary>
- /// The hash algorithm type.
+ /// Hash algorithm type.
/// </summary>
HashAlgorithm,
/// <summary>
- /// The RSA padding algorithm type.
+ /// RSA padding algorithm type.
/// </summary>
RsaPaddingAlgorithm
}
namespace Tizen.Security.SecureRepository.Crypto
{
/// <summary>
- /// An abstract class for holding parameters for signing and verification.
+ /// Holds parameters for signing and verification.
/// </summary>
/// <since_tizen> 3 </since_tizen>
abstract public class SignatureParameters
private Dictionary<SignatureParameterName, int> _parameters;
/// <summary>
- /// The signature algorithm type.
+ /// Gets signature algorithm type.
/// </summary>
+ /// <value>
+ /// Signature algorithm type.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public SignatureAlgorithmType SignatureAlgorithm
{
}
/// <summary>
- /// The hash algorithm used in signing anve verification.
+ /// Gets and sets hash algorithm.
/// </summary>
+ /// <value>
+ /// Hash algorithm used in signing and verification.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public HashAlgorithm HashAlgorithm
{
public enum DataFormat : int
{
/// <summary>
- /// The DER format base64 encoded data.
+ /// DER format base64 encoded data.
/// </summary>
DerBase64 = 0,
/// <summary>
- /// The DER encoded data.
+ /// DER encoded data.
/// </summary>
Der,
/// <summary>
- /// The PEM encoded data. It consists of the DER format base64 encoded
- /// with additional header and footer lines.
+ /// PEM encoded data.
/// </summary>
+ /// <remarks>
+ /// Consists of the DER format base64 encoded with additional header and footer lines.
+ /// </remarks>
Pem
}
}
namespace Tizen.Security.SecureRepository
{
/// <summary>
- /// This class provides the methods for storing and retrieving data.
+ /// Provides methods for storing and retrieving data.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class DataManager : Manager
/// Gets data from the secure repository.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="alias">The name of a certificate to retrieve.</param>
+ /// <param name="alias">Name of a certificate to retrieve.</param>
/// <param name="password">
- /// The password used in decrypting a data value.
+ /// Password used in decrypting a data value.
/// If password of policy is provided in SaveData(), the same password should
/// be provided.
/// </param>
/// <returns>Data specified by alias.</returns>
/// <exception cref="ArgumentNullException">
- /// The alias argument is null.
+ /// Thrown when <paramref name="alias"/> argument is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// The alias argument is in the invalid format.
+ /// Thrown when <paramref name="alias"/> argument has an invalid format.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Data does not exist with the alias or data-protecting password isn't matched.
+ /// Thrown when data does not exist with the <paramref name="alias"/>
+ /// or data-protecting password does not match.
/// </exception>
static public byte[] Get(string alias, string password)
{
}
/// <summary>
- /// Gets all aliases of data, which the client can access.
+ /// Gets all aliases of data accessible by the client.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <returns>All aliases of data, which the client can access.</returns>
- /// <exception cref="ArgumentException">No alias to get.</exception>
+ /// <returns>All aliases of data accessible by the client.</returns>
+ /// <exception cref="ArgumentException">Thrown when there's no alias to get.</exception>
static public IEnumerable<string> GetAliases()
{
IntPtr ptr = IntPtr.Zero;
/// Stores data inside the secure repository based on the provided policy.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="alias">The name of data to be stored.</param>
- /// <param name="data">The binary value to be stored.</param>
- /// <param name="policy">The policy about how to store data securely.</param>
- /// <exception cref="ArgumentNullException">
- /// Any of argument is null.
- /// </exception>
+ /// <param name="alias">Name of data to be stored.</param>
+ /// <param name="data">Binary value to be stored.</param>
+ /// <param name="policy">Data stoting policy.</param>
+ /// <exception cref="ArgumentNullException">Any argument is null.</exception>
/// <exception cref="ArgumentException">
- /// The alias argument is in the invalid format. Data policy cannot be unextractable.
+ /// Thrown when <paramref name="alias"/> argument has an invalid format.
+ /// Thrown when <paramref name="policy"/> cannot be unextractable.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Data with alias already exist.
+ /// Thrown when data with given <paramref name="alias"/> already exists.
/// </exception>
static public void Save(string alias, byte[] data, Policy policy)
{
public enum EllipticCurveType : int
{
/// <summary>
- /// The elliptic curve domain "secp192r1" listed in "SEC 2" recommended elliptic curve domain.
+ /// Elliptic curve domain "secp192r1" listed in "SEC 2" recommended elliptic curve domain.
/// </summary>
Prime192V1 = 0,
/// <summary>
- /// The "SEC 2" recommended elliptic curve domain - secp256r1.
+ /// "SEC 2" recommended elliptic curve domain - secp256r1.
/// </summary>
Prime256V1,
/// <summary>
- /// The NIST curve P-384(covers "secp384r1", the elliptic curve domain listed in See SEC 2.
+ /// NIST curve P-384(covers "secp384r1", the elliptic curve domain listed in See SEC 2.
/// </summary>
Secp384R1
}
namespace Tizen.Security.SecureRepository
{
/// <summary>
- /// The class that represents a key.
+ /// Represents a key.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class Key
{
/// <summary>
- /// A constructor of Key that takes the binary, its type, and optional password
- /// of binary.
+ /// Initializes an instance of Key class with a binary, key type and a binary password.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="binary">
- /// The binary value of a key. This binary may be encrypted with binaryPassword.
- /// </param>
- /// <param name="type">The key's type.</param>
+ /// <remarks>
+ /// The binary may be encrypted with binaryPassword.
+ /// </remarks>
+ /// <param name="binary">Binary value of a key.</param>
+ /// <param name="type">Key type.</param>
/// <param name="binaryPassword">
- /// The password used to decrypt binary when binary is encrypted.
+ /// Password used to decrypt binary when it's encrypted.
/// </param>
public Key(byte[] binary, KeyType type, string binaryPassword)
{
}
/// <summary>
- /// The binary value of a key.
+ /// Gets and sets binary value of a key.
/// </summary>
+ /// <value>
+ /// Binary value of a key.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public byte[] Binary
{
}
/// <summary>
- /// The key's type.
+ /// Gets and sets key type.
/// </summary>
+ /// <value>
+ /// Key type.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public KeyType Type
{
}
/// <summary>
- /// The password used to decrypt binary when binary is encrypted. It's optional.
+ /// Gets and sets password.
/// </summary>
+ /// <value>
+ /// Password used to decrypt binary when it's encrypted (Optional).
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public string BinaryPassword
{
namespace Tizen.Security.SecureRepository
{
/// <summary>
- /// This class provides the methods for storing, retrieving, and creating keys.
+ /// Provides methods for storing, retrieving, and creating keys.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class KeyManager : Manager
/// Gets a key from the secure repository.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="alias">The name of a key to retrieve.</param>
+ /// <param name="alias">Name of a key to retrieve.</param>
/// <param name="password">
- /// The password used in decrypting a key value.
+ /// Password used in decrypting key value.
/// If password of policy is provided in SaveKey(), the same password should
/// be provided.
/// </param>
- /// <returns>A key specified by alias.</returns>
- /// <exception cref="ArgumentNullException">
- /// The alias argument is null.
- /// </exception>
+ /// <returns>Key specified by alias.</returns>
+ /// <exception cref="ArgumentNullException">Thrown when <paramref name="alias"/> argument is null.</exception>
/// <exception cref="ArgumentException">
- /// The alias argument is in the invalid format.
+ /// Thrown when <paramref name="alias"/> argument has an invalid format.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// The key does not exist with the alias or the key-protecting password isn't matched.
+ /// Thrown when key does not exist with given <paramref name="alias"/>
+ /// or the key-protecting password does not match.
/// </exception>
static public Key Get(string alias, string password)
{
}
/// <summary>
- /// Gets all aliases of keys, which the client can access.
+ /// Gets all aliases of keys accessible by the client.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <returns>All aliases of keys, which the client can access.</returns>
- /// <exception cref="ArgumentException">No alias to get.</exception>
+ /// <returns>All aliases of keys accessible by the client.</returns>
+ /// <exception cref="ArgumentException">Thrown when there's no alias to get.</exception>
static public IEnumerable<string> GetAliases()
{
IntPtr ptr = IntPtr.Zero;
/// Stores a key inside the secure repository based on the provided policy.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="alias">The name of a key to be stored.</param>
- /// <param name="key">The key's binary value to be stored.</param>
- /// <param name="policy">The policy about how to store a key securely.</param>
- /// <exception cref="ArgumentNullException">
- /// Any of argument is null.
- /// </exception>
- /// <exception cref="ArgumentException">
- /// The alias argument is in the invalid format. key argument is in the invalid format.
- /// </exception>
- /// <exception cref="InvalidOperationException">
- /// The key with alias does already exist.
- /// </exception>
/// <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.
+ /// Type in key may be set to KeyType. None as an input.
+ /// Type is determined inside the secure repository during storing keys.
/// </remarks>
/// <remarks>
/// If the password in policy is provided, the key is additionally encrypted with
/// the password in policy.
/// </remarks>
+ /// <param name="alias">Name of a key to be stored.</param>
+ /// <param name="key">Key's binary value to be stored.</param>
+ /// <param name="policy">Key storing policy.</param>
+ /// <exception cref="ArgumentNullException">
+ /// Thrown when any provided argument is null.
+ /// </exception>
+ /// <exception cref="ArgumentException">
+ /// Thrown when <paramref name="alias"/> or <paramref name="key"/> argument has an invalid format.
+ /// </exception>
+ /// <exception cref="InvalidOperationException">
+ /// Thrown when key with given alias already exists.
+ /// </exception>
static public void Save(string alias, Key key, Policy policy)
{
if (alias == null || key == null || policy == null)
}
/// <summary>
- /// Creates the RSA private/public key pair and stores them inside the secure repository
+ /// Creates RSA private/public key pair and stores them inside the secure repository
/// based on each policy.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="size">
- /// The size of key strength to be created. 1024, 2048, and 4096 are supported.
- /// </param>
- /// <param name="privateKeyAlias">The name of private key to be stored.</param>
- /// <param name="publicKeyAlias">The name of public key to be stored.</param>
- /// <param name="privateKeyPolicy">
- /// The policy about how to store a private key securely.
- /// </param>
- /// <param name="publicKeyPolicy">
- /// The policy about how to store a public key securely.
- /// </param>
+ /// <remarks>
+ /// 1024, 2048, and 4096 sizes are supported.
+ /// </remarks>
+ /// <remarks>
+ /// If the password in policy is provided, the key is additionally encrypted with the
+ /// password in policy.
+ /// </remarks>
+ /// <param name="size">Size of key strength to be created.</param>
+ /// <param name="privateKeyAlias">Name of a private key to be stored.</param>
+ /// <param name="publicKeyAlias">Name of a public key to be stored.</param>
+ /// <param name="privateKeyPolicy">Private key storing policy.</param>
+ /// <param name="publicKeyPolicy">Public key storing policy.</param>
/// <exception cref="ArgumentNullException">
- /// Any of argument is null.
+ /// Thrown when any provided argument is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// The size is invalid. privateKeyAlias or publicKeyAlias is invalid format.
+ /// Thrown when <paramref name="size"/> is invalid.
+ /// Thrown when <paramref name="privateKeyAlias"/> or
+ /// <paramref name="publicKeyAlias"/> has an invalid format.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// The key with privateKeyAlias or publicKeyAlias does already exist.
+ /// Thrown when key with <paramref name="privateKeyAlias"/> or <paramref name="publicKeyAlias"/> already exists.
/// </exception>
- /// <remarks>
- /// If the password in policy is provided, the key is additionally encrypted with the
- /// password in policy.
- /// </remarks>
static public void CreateRsaKeyPair(
int size, string privateKeyAlias, string publicKeyAlias,
Policy privateKeyPolicy, Policy publicKeyPolicy)
}
/// <summary>
- /// Creates the DSA private/public key pair and stores them inside the secure repository
+ /// Creates DSA private/public key pair and stores them inside the secure repository
/// based on each policy.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="size">
- /// The size of key strength to be created. 1024, 2048, 3072, and 4096 are
- /// supported.
- /// </param>
- /// <param name="privateKeyAlias">The name of private key to be stored.</param>
- /// <param name="publicKeyAlias">The name of public key to be stored.</param>
- /// <param name="privateKeyPolicy">
- /// The policy about how to store a private key securely.
- /// </param>
- /// <param name="publicKeyPolicy">
- /// The policy about how to store a public key securely.
- /// </param>
+ /// <remarks>
+ /// 1024, 2048, 3072, and 4096 sizes are supported.
+ /// </remarks>
+ /// <remarks>
+ /// If the password in policy is provided, the key is additionally encrypted with
+ /// the password in policy.
+ /// </remarks>
+ /// <param name="size">Size of key strength to be created.</param>
+ /// <param name="privateKeyAlias">Name of a private key to be stored.</param>
+ /// <param name="publicKeyAlias">Name of a public key to be stored.</param>
+ /// <param name="privateKeyPolicy">Private key storing policy.</param>
+ /// <param name="publicKeyPolicy">Public key storing policy.</param>
/// <exception cref="ArgumentNullException">
- /// Any of argument is null.
+ /// Thrown when any provided argument is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// The size is invalid. privateKeyAlias or publicKeyAlias is invalid format.
+ /// Thrown when <paramref name="size"/> is invalid.
+ /// Thrown when <paramref name="privateKeyAlias"/> or
+ /// <paramref name="publicKeyAlias"/> has an invalid format.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// The key with privateKeyAlias or publicKeyAlias does already exist.
+ /// Thrown when key with <paramref name="privateKeyAlias"/> or
+ /// <paramref name="publicKeyAlias"/> already exists.
/// </exception>
- /// <remarks>
- /// If the password in policy is provided, the key is additionally encrypted with
- /// the password in policy.
- /// </remarks>
static public void CreateDsaKeyPair(
int size, string privateKeyAlias, string publicKeyAlias,
Policy privateKeyPolicy, Policy publicKeyPolicy)
}
/// <summary>
- /// Creates the ECDSA private/public key pair and stores them inside secure repository
+ /// Creates ECDSA private/public key pair and stores them inside secure repository
/// based on each policy.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="type">The type of elliptic curve of ECDSA.</param>
- /// <param name="privateKeyAlias">The name of private key to be stored.</param>
- /// <param name="publicKeyAlias">The name of public key to be stored.</param>
- /// <param name="privateKeyPolicy">
- /// The policy about how to store a private key securely.
- /// </param>
- /// <param name="publicKeyPolicy">
- /// The policy about how to store a public key securely.
- /// </param>
+ /// <remarks>
+ /// If the password in policy is provided, the key is additionally encrypted with
+ /// the password in policy.
+ /// </remarks>
+ /// <param name="type">Type of elliptic curve of ECDSA.</param>
+ /// <param name="privateKeyAlias">Name of private key to be stored.</param>
+ /// <param name="publicKeyAlias">Name of public key to be stored.</param>
+ /// <param name="privateKeyPolicy">Private key storing policy.</param>
+ /// <param name="publicKeyPolicy">Public key storing policy.</param>
/// <exception cref="ArgumentNullException">
- /// Any of argument is null.
+ /// Thrown when any provided argument is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// The elliptic curve type is invalid. privateKeyAlias or publicKeyAlias is in the
- /// invalid format.
+ /// Thrown when <paramref name="type"/> is invalid.
+ /// Thrown when <paramref name="privateKeyAlias"/> or
+ /// <paramref name="publicKeyAlias"/> has an invalid format.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// The key with privateKeyAlias or publicKeyAlias does already exist.
+ /// Thrown when key with <paramref name="privateKeyAlias"/> or
+ /// <paramref name="publicKeyAlias"/> already exists.
/// </exception>
- /// <remarks>
- /// If the password in policy is provided, the key is additionally encrypted with
- /// the password in policy.
- /// </remarks>
static public void CreateEcdsaKeyPair(
EllipticCurveType type, string privateKeyAlias, string publicKeyAlias,
Policy privateKeyPolicy, Policy publicKeyPolicy)
}
/// <summary>
- /// Creates the AES key and stores it inside the secure repository based on each policy.
+ /// Creates AES key and stores it inside the secure repository based on policy.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="size">
- /// The size of the key strength to be created. 128, 192 and 256 are supported.
- /// </param>
+ /// <remarks>
+ /// 128, 192 and 256 sizes are supported.
+ /// </remarks>
+ /// <remarks>
+ /// If the password in policy is provided, the key is additionally encrypted with
+ /// the password in policy.
+ /// </remarks>
+ /// <param name="size">Size of the key strength to be created.</param>
/// <param name="keyAlias">The name of key to be stored.</param>
- /// <param name="policy">The policy about how to store the key securely.</param>
+ /// <param name="policy">Key storing policy.</param>
/// <exception cref="ArgumentNullException">
- /// The keyAlias or policy is null.
+ /// Thrown when <paramref name="keyAlias"/> or <paramref name="policy"/> is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// The key size is invalid. keyAlias is in the invalid format.
+ /// Thrown when <paramref name="size"/> is invalid.
+ /// Thrown when <paramref name="keyAlias"/> has an invalid format.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// The key with privateKeyAlias or publicKeyAlias does already exist.
+ /// Thrown when key with <paramref name="keyAlias"/> already exists.
/// </exception>
- /// <remarks>
- /// If the password in policy is provided, the key is additionally encrypted with
- /// the password in policy.
- /// </remarks>
static public void CreateAesKey(int size, string keyAlias, Policy policy)
{
if (size != 128 && size != 192 && size != 256)
/// </summary>
None = 0,
/// <summary>
- /// The RSA public key.
+ /// RSA public key.
/// </summary>
RsaPublic,
/// <summary>
- /// The RSA private key.
+ /// RSA private key.
/// </summary>
RsaPrivate,
/// <summary>
- /// The ECDSA public key.
+ /// ECDSA public key.
/// </summary>
EcdsaPublic,
/// <summary>
- /// The ECDSA private key.
+ /// ECDSA private key.
/// </summary>
EcdsaPrivate,
/// <summary>
- /// The DSA public key.
+ /// DSA public key.
/// </summary>
DsaPublic,
/// <summary>
- /// The DSA private key.
+ /// DSA private key.
/// </summary>
DsaPrivate,
/// <summary>
- /// The AES key.
+ /// AES key.
/// </summary>
Aes
}
public class Manager
{
/// <summary>
- /// Creates a new full alias, which is concatenation of owner ID and alias.
+ /// Creates a new full alias, which is a concatenation of owner ID and alias.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="ownerId">Data owner's ID. This should be package ID if data
- /// owner is application. If you want to access data stored by system services,
- /// use CreateFullSystemAlias() instead.</param>
+ /// <remarks>
+ /// Data owner's ID should be package ID, if data owner is an application.
+ /// If you want to access data stored by system services, use CreateFullSystemAlias() instead.
+ /// </remarks>
+ /// <param name="ownerId">Data owner's ID.</param>
/// <param name="alias">Data alias.</param>
static public string CreateFullAlias(string ownerId, string alias)
{
}
/// <summary>
- /// Creates a new full alias, which is concatenation of system service's
+ /// Creates a new full alias, which is a concatenation of system service's
/// owner ID and alias.
/// </summary>
/// <since_tizen> 3 </since_tizen>
}
/// <summary>
- /// Removes an entry (no matter of type) from the key manager.
+ /// Removes an entry (no matter what type) from the key manager.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="alias">Item alias to be removed.</param>
- /// <exception cref="ArgumentNullException">The alias is null.</exception>
- /// <exception cref="ArgumentException">The alias is in the invalid format.</exception>
- /// <exception cref="InvalidOperationException">The alias does not exist.</exception>
/// <remarks>
/// To remove item, client must remove permission to the specified item.
/// </remarks>
- /// <remarks>The item owner can remove by default.</remarks>
+ /// <remarks>The item owner can remove an entry by default.</remarks>
+ /// <param name="alias">Item alias to be removed.</param>
+ /// <exception cref="ArgumentNullException">Thrown when <paramref name="alias"/> is null.</exception>
+ /// <exception cref="ArgumentException">
+ /// Thrown when <paramref name="alias"/> is in the invalid format.
+ /// </exception>
+ /// <exception cref="InvalidOperationException">
+ /// Thrown when <paramref name="alias"/> does not exist.
+ /// </exception>
static public void RemoveAlias(string alias)
{
if (alias == null)
/// Allows another application to access client's application data.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <remarks>Data identified by alias should exist.</remarks>
+ /// <remarks>The item owner can set permissions.</remarks>
/// <param name="alias">Item alias for which access will be granted.</param>
/// <param name="otherPackageId">
/// Package ID of the application that will gain access rights.
/// otherPackageId.
/// </param>
/// <exception cref="ArgumentNullException">
- /// The alias or otherPackageId is null.
+ /// Thrown when <paramref name="alias"/> or <paramref name="otherPackageId"/> is null.
/// </exception>
/// <exception cref="ArgumentException">
- /// The alias or otherPackageId is in the invalid format.
+ /// Thrown when <paramref name="alias"/> or
+ /// <paramref name="otherPackageId"/> has an invalid format.
/// </exception>
- /// <exception cref="InvalidOperationException">The alias does not exist.</exception>
- /// <remarks>Data identified by alias should exist.</remarks>
- /// <remarks>The item owner can set permissions.</remarks>
+ /// <exception cref="InvalidOperationException">
+ /// Thrown when <paramref name="alias"/> does not exist.
+ ///</exception>
static public void SetPermission(
string alias, string otherPackageId, int permissions)
{
namespace Tizen.Security.SecureRepository
{
/// <summary>
- /// Enumeration for the OCSP status.
+ /// [Obsolete("Please do not use! This will be deprecated!")]
/// </summary>
/// <since_tizen> 3 </since_tizen>
[Obsolete("Please do not use! This will be deprecated with API9 and removed with API11! Please use raw OpenSSL instead!")]
public enum OcspStatus : int
{
/// <summary>
- /// The OCSP status is good.
+ /// OCSP status is good.
/// </summary>
Good = 0x00,
/// <summary>
- /// The certificate is revoked.
+ /// Certificate is revoked.
/// </summary>
Revoked = 0x01,
/// <summary>
/// </summary>
Unknown = 0x02,
/// <summary>
- /// The certificate does not provide the OCSP extension.
+ /// Certificate does not provide the OCSP extension.
/// </summary>
Unsupported = 0x03,
/// <summary>
- /// The invalid URL in the certificate OCSP extension.
+ /// Invalid URL in the certificate OCSP extension.
/// </summary>
InvalidUrl = 0x04,
/// <summary>
- /// The invalid response from the OCSP server.
+ /// Invalid response from the OCSP server.
/// </summary>
InvalidResponse = 0x05,
/// <summary>
- /// The OCSP remote server error.
+ /// OCSP remote server error.
/// </summary>
RemoteError = 0x06,
/// <summary>
- /// The Network connection error.
+ /// Network connection error.
/// </summary>
NetworkError = 0x07,
/// <summary>
- /// An Internal error.
+ /// Internal error.
/// </summary>
InternalError = 0x08
}
namespace Tizen.Security.SecureRepository
{
/// <summary>
- /// The class that represents a PKCS#12 contents.
- /// It has a private key or its certificate or all the members of a chain of trust.
+ /// Represents PKCS#12 contents.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <remarks>
+ /// It has a private key or its certificate or all members of a chain of trust.
+ /// </remarks>
public class Pkcs12
{
private SafeCertificateListHandle _certChainHandle = null;
/// <summary>
- /// Loads the Pkcs12 from the given PKCS#12 file path.
+ /// Loads Pkcs12 from the given PKCS#12 file path.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="filePath">The path of the PKCS12 file to be loaded.</param>
- /// <param name="filePassword">The passphrase used to decrypt the PCKS12 file.
- /// If the PKCS12 file is not encrypted, passphrase can be null.</param>
- /// <exception cref="ArgumentNullException">The filePath is null.</exception>
+ /// <remarks>
+ /// If the PKCS12 file is not encrypted, passphrase can be null.
+ /// </remarks>
+ /// <param name="filePath">Path of the PKCS12 file to be loaded.</param>
+ /// <param name="filePassword">Passphrase used to decrypt the PCKS12 file.</param>
+ /// <exception cref="ArgumentNullException">Thrown when filePath is null.</exception>
/// <exception cref="InvalidOperationException">
- /// No file on filePath.
- /// No permission to access file.
- /// File is in the invalid PKCS12 format.
- /// File cannot be extracted with provided filePassword.
+ /// Thrown when there's no existing file on <paramref name="filePath"/>.
+ /// Thrown when there are not sufficient permissions to access the file.
+ /// Thrown when file has an invalid PKCS12 format.
+ /// Thrown when file cannot be extracted with provided <paramref name="filePassword"/>.
/// </exception>
static public Pkcs12 Load(string filePath, string filePassword)
{
}
/// <summary>
- /// A constructor of Key that takes a private key.
+ /// Initializes an instance of Pkcs12 class with a private key.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <param name="privateKey">A private key.</param>
}
/// <summary>
- /// A constructor of Key that takes a private key, its corresponding certicate,
- /// and CA's certificate chain.
+ /// Initializes an instance of Pkcs12 class with a private key,
+ /// its corresponding certificate and CA's certificate chain.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="privateKey">A private key.</param>
- /// <param name="certificate">A certificate corresponding the private key.</param>
+ /// <param name="privateKey">Private key.</param>
+ /// <param name="certificate">Certificate corresponding to the private key.</param>
/// <param name="caChain">
- /// A certificate chain of CA(Certificate Authority) that issued the certificate.
+ /// Certificate chain of CA (Certificate Authority) that issued the certificate.
/// </param>
public Pkcs12(Key privateKey,
Certificate certificate,
}
/// <summary>
- /// A private key.
+ /// Gets and sets private key.
/// </summary>
+ /// <value>
+ /// Private key.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public Key PrivateKey
{
}
/// <summary>
- /// A certificate corresponding to the private key.
+ /// Gets and sets a certificate.
/// </summary>
+ /// <value>
+ /// Certificate corresponding to the private key.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public Certificate Certificate
{
}
/// <summary>
- /// A certificate chain of CA(Certificate Authority) that issued the certificate.
+ /// Gets and sets a certificate chain.
/// </summary>
+ /// <value>
+ /// Certificate chain of CA (Certificate Authority) that issued the certificate.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public IEnumerable<Certificate> CaChain
{
namespace Tizen.Security.SecureRepository
{
/// <summary>
- /// This class provides the methods for storing and retrieving the Pkcs12 contents.
+ /// Provides methods for storing and retrieving Pkcs12 contents.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class Pkcs12Manager : Manager
/// Gets Pkcs12 contents from the secure repository.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="alias">The name of data to retrieve.</param>
- /// <param name="keyPassword">
- /// The password used in decrypting a private key value. If password of
- /// keyPolicy is provided in SavePkcs12(), the same password should be provided.
- /// </param>
+ /// <remarks>
+ /// If password of keyPolicy is provided in SavePkcs12(),
+ /// the same password should be provided in as keyPassword argument.
+ /// </remarks>
+ /// <remarks>
+ /// If password of certificatePolicy is provided in SavePkcs12(),
+ /// the same password should be provided in as cerificatePassword argument.
+ /// </remarks>
+ /// <param name="alias">Name of data to retrieve.</param>
+ /// <param name="keyPassword">Password used in decrypting a private key value.</param>
/// <param name="cerificatePassword">
- /// The password used in decrypting a certificate value. If password of
- /// certificatePolicy is provided in SavePkcs12(), the same password should be
- /// provided.
+ /// Password used in decrypting a certificate value.
/// </param>
- /// <returns>A Pkcs12 data specified by alias.</returns>
- /// <exception cref="ArgumentNullException">The alias argument is null.</exception>
+ /// <returns>Pkcs12 data specified by alias.</returns>
+ /// <exception cref="ArgumentNullException">Thrown when <paramref name="alias"/> argument is null.</exception>
/// <exception cref="ArgumentException">
- /// The alias argument is in the invalid format.
+ /// Thrown when <paramref name="alias"/> argument has an invalid format.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Pkcs12 does not exist with the alias.
- /// Optional password of key in Pkcs12 isn't matched.
- /// Optional password of certificate in Pkcs12 isn't matched.
+ /// Thrown when Pkcs12 does not exist with given <paramref name="alias"/>.
+ /// Thrown when optional password of key in Pkcs12 does not match.
+ /// Thrown when optional password of certificate in Pkcs12 does not match.
/// </exception>
static public Pkcs12 Get(
string alias, string keyPassword, string cerificatePassword)
}
/// <summary>
- /// Stores PKCS12's contents inside key manager based on the provided policies.
- /// All items from the PKCS12 will use the same alias.
+ /// Stores PKCS12's contents inside key manager based on provided policies.
+ /// All items from PKCS12 will use the same alias.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="alias">The name of a data to be stored.</param>
- /// <param name="pkcs12">The pkcs12 data to be stored.</param>
- /// <param name="keyPolicy">
- /// The policy about how to store pkcs's private key.
- /// </param>
- /// <param name="certificatePolicy">
- /// The policy about how to store pkcs's certificate.
- /// </param>
- /// <exception cref="ArgumentNullException">Any of argument is null.</exception>
+ /// <param name="alias">Name of a data to be stored.</param>
+ /// <param name="pkcs12">pkcs12 data to be stored.</param>
+ /// <param name="keyPolicy">Pkcs' private key storing policy.</param>
+ /// <param name="certificatePolicy">Pkcs' certificate storing policy.</param>
+ /// <exception cref="ArgumentNullException">
+ /// Thrown when any provided argument is null.
+ /// </exception>
/// <exception cref="ArgumentException">
- /// The alias argument is in the invalid format. Pkcs12 argument is in the invalid format.
+ /// Thrown when <paramref name="alias"/> or
+ /// <paramref name="pkcs12"/> argument has an invalid format.
/// </exception>
/// <exception cref="InvalidOperationException">
- /// Pkcs12 with alias does already exist.
+ /// Thrown when pkcs12 with given <paramref name="alias"/> already exists.
/// </exception>
static public void Save(
string alias, Pkcs12 pkcs12, Policy keyPolicy, Policy certificatePolicy)
namespace Tizen.Security.SecureRepository
{
/// <summary>
- /// A class for a policy for storing key, certificate, and binary data.
+ /// Stores policy for key, certificate, and binary data.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public class Policy
{
/// <summary>
- /// A default constructor of Policy with default policy.
+ /// Initializes an instance of Policy class.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <remarks>The default value for Password is null and the default value for Extractabl is false.</remarks>
+ /// <remarks>Default value for Password is null and default value for Extractable is false.</remarks>
public Policy()
{
Password = null;
}
/// <summary>
- /// A constructor of Key that takes the password and the flag for extractable.
+ /// Initializes an instance of Policy class with password and extractable flag.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- /// <param name="password">Used to encrypt data secure repository.</param>
+ /// <param name="password">Used to encrypt data in secure repository.</param>
/// <param name="extractable">If true, key may be extracted from the secure repository.</param>
public Policy(String password, bool extractable)
{
}
/// <summary>
- /// Used to encrypt data secure repository. If it is not null, the data
- /// (or key, or certificate) is stored encrypted with this password inside secure repository.
+ /// Gets and sets password.
/// </summary>
+ /// <value>
+ /// Used to encrypt data in secure repository. If it is not null, the data
+ /// (or key, or certificate) is stored encrypted with this password inside secure repository.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public String Password
{
}
/// <summary>
- /// If true, key may be extracted from the secure repository.
+ /// Gets and sets Extractable flag.
/// </summary>
+ /// <value>
+ /// Extractable flag. If true, key may be extracted from the secure repository.
+ /// </value>
/// <since_tizen> 3 </since_tizen>
public bool Extractable
{