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.
Inheritance: System.Security.Cryptography.SymmetricAlgorithm
コード例 #1
0
ファイル: SecurityPolicy.cs プロジェクト: pcbing/brunet
        /// <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
ファイル: SecurityPolicy.cs プロジェクト: johnynek/brunet
    /// <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;
    }