/// <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); } }
/// <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; }
/// <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)); }