Exemplo n.º 1
0
        /// <summary>
        /// Creates the provider.
        /// </summary>
        /// <param name="aesKeys">The aes keys.</param>
        /// <returns></returns>
        public static RijndaelProvider CreateProvider(IAesKeys aesKeys)
        {
            try
            {
                aesKeys.CheckNullObject(nameof(aesKeys));

                var key = aesKeys.Key;
                var iv  = aesKeys.InitializationVector;
                key.CheckNullOrEmpty(nameof(key));
                iv.CheckNullOrEmpty(nameof(iv));

                return(new RijndaelProvider(aesKeys));
            }
            catch (Exception ex)
            {
                throw ex.Handle(aesKeys);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RijndaelProvider"/> class.
 /// </summary>
 /// <param name="aesKeys">The aes keys.</param>
 private RijndaelProvider(IAesKeys aesKeys)
 {
     _aesKeys = aesKeys;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates the aes provider.
 /// </summary>
 /// <param name="aesKeys">The aes keys.</param>
 /// <returns></returns>
 public static RijndaelProvider CreateAesProvider(this IAesKeys aesKeys)
 {
     return(RijndaelProvider.CreateProvider(aesKeys));
 }