Beispiel #1
0
        public CryptoServiceProvider(CryptoServiceProviderOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            if (options.InitializationVector == null)
            {
                throw new ArgumentNullException("options.InitializationVector");
            }
            if (options.InitializationVector.Length == 0)
            {
                throw new ArgumentOutOfRangeException("options.InitializationVector");
            }

            if (options.Key == null)
            {
                throw new ArgumentNullException("options.Key");
            }
            if (options.Key.Length == 0)
            {
                throw new ArgumentOutOfRangeException("options.Key");
            }

            _options = options;
        }
Beispiel #2
0
 public CryptoService(CryptoServiceProviderOptions options)
 {
     _cryptoServiceProvider = new CryptoServiceProvider(options);
 }