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