Provides a Null SymmetricAlgorithm, its blazing fast! Typically, these classes are not thread-safe, but since the block size is 1 and there is no history, it is thread-safe.
Наследование: System.Security.Cryptography.SymmetricAlgorithm
Пример #1
0
        /// <summary>Creates a SymmetricAlgorithm used by this SPI.</summary>
        public SymmetricAlgorithm CreateSymmetricAlgorithm()
        {
            SymmetricAlgorithm sa = null;

            if (Encryptor.Equals("NullEncryption"))
            {
                sa = new NullEncryption();
            }
            else
            {
                sa = SymmetricAlgorithm.Create(Encryptor);
            }

            if (sa == null)
            {
                throw new Exception("Unsupported encryption algorithm: " + Encryptor);
            }

            return(sa);
        }
Пример #2
0
    /// <summary>Creates a SymmetricAlgorithm used by this SPI.</summary>
    public SymmetricAlgorithm CreateSymmetricAlgorithm() {
      SymmetricAlgorithm sa = null;

      if(Encryptor.Equals("NullEncryption")) {
        sa = new NullEncryption();
      } else {
        sa = SymmetricAlgorithm.Create(Encryptor);
      }

      if(sa == null) {
        throw new Exception("Unsupported encryption algorithm: " + Encryptor);
      }

      return sa;
    }