• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SymmetricKeyAlgorithmTag类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SymmetricKeyAlgorithmTag的典型用法代码示例。如果您正苦于以下问题:C# SymmetricKeyAlgorithmTag类的具体用法?C# SymmetricKeyAlgorithmTag怎么用?C# SymmetricKeyAlgorithmTag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SymmetricKeyAlgorithmTag类属于命名空间,在下文中一共展示了SymmetricKeyAlgorithmTag类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PgpEncryptedDataGenerator

 /// <summary>Existing SecureRandom constructor.</summary>
 /// <param name="encAlgorithm">The symmetric algorithm to use.</param>
 /// <param name="rand">Source of randomness.</param>
 public PgpEncryptedDataGenerator(
     SymmetricKeyAlgorithmTag	encAlgorithm,
     SecureRandom				rand)
 {
     this.defAlgorithm = encAlgorithm;
     this.rand = rand;
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:10,代码来源:PgpEncryptedDataGenerator.cs


示例2: ECDHPublicKeyParameters

 /// <summary>
 /// Initializes a new instance of the <see cref="ECDHPublicKeyParameters" /> class.
 /// </summary>
 /// <param name="q">The q.</param>
 /// <param name="parameters">The parameters.</param>
 /// <param name="hashAlgorithm">The hash algorithm.</param>
 /// <param name="symmetricKeyAlgorithm">The symmetric key algorithm.</param>
 public ECDHPublicKeyParameters(ECPoint q, ECDomainParameters parameters, HashAlgorithmTag hashAlgorithm,
                                SymmetricKeyAlgorithmTag symmetricKeyAlgorithm)
     : base("ECDH", q, parameters)
 {
     this.HashAlgorithm = hashAlgorithm;
     this.SymmetricKeyAlgorithm = symmetricKeyAlgorithm;
 }
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:14,代码来源:ECDHPublicKeyParameters.cs


示例3: ECKeyGenerationParameters

 /// <summary>
 /// Initializes a new instance of the <see cref="ECKeyGenerationParameters"/> class.
 /// </summary>
 /// <param name="publicKeyParamSet">The public key param set.</param>
 /// <param name="random">The random.</param>
 /// <param name="hashAlgorithm">The hash algorithm.</param>
 /// <param name="symmetricKeyAlgorithm">The symmetric key algorithm.</param>
 public ECKeyGenerationParameters(DerObjectIdentifier publicKeyParamSet, ISecureRandom random, HashAlgorithmTag hashAlgorithm, SymmetricKeyAlgorithmTag symmetricKeyAlgorithm)
     : this(ECKeyParameters.LookupParameters(publicKeyParamSet), random)
 {
     _publicKeyParamSet = publicKeyParamSet;
     _hashAlgorithm = hashAlgorithm;
     _symmetricKeyAlgorithm = symmetricKeyAlgorithm;
 }
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:14,代码来源:ECKeyGenerationParameters.cs


示例4: SymmetricKeyEncSessionPacket

 /// <summary>
 /// Initializes a new instance of the <see cref="SymmetricKeyEncSessionPacket"/> class.
 /// </summary>
 /// <param name="encAlgorithm">The enc algorithm.</param>
 /// <param name="s2k">The S2K.</param>
 /// <param name="secKeyData">The sec key data.</param>
 public SymmetricKeyEncSessionPacket(SymmetricKeyAlgorithmTag encAlgorithm, S2k s2k, byte[] secKeyData)
 {
     this.Version = 4;
     this.EncAlgorithm = encAlgorithm;
     this.S2K = s2k;
     this._secKeyData = secKeyData;
 }
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:13,代码来源:SymmetricKeyEncSessionPacket.cs


示例5: SecretKeyPacket

        internal SecretKeyPacket(
            BcpgInputStream bcpgIn)
        {
            pubKeyPacket = new PublicKeyPacket(bcpgIn);

            s2kUsage = bcpgIn.ReadByte();

            if (s2kUsage == UsageChecksum || s2kUsage == UsageSha1)
            {
                encAlgorithm = (SymmetricKeyAlgorithmTag) bcpgIn.ReadByte();
                s2k = new S2k(bcpgIn);
            }
            else
            {
                encAlgorithm = (SymmetricKeyAlgorithmTag) s2kUsage;
            }

            if (!(s2k != null && s2k.Type == S2k.GnuDummyS2K && s2k.ProtectionMode == 0x01))
            {
                if (s2kUsage != 0)
                {
                    if (((int) encAlgorithm) < 7)
                    {
                        iv = new byte[8];
                    }
                    else
                    {
                        iv = new byte[16];
                    }
                    bcpgIn.ReadFully(iv);
                }
            }

            secKeyData = bcpgIn.ReadAll();
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:35,代码来源:SecretKeyPacket.cs


示例6: Create

        /// <summary>
        /// Creates a ECDH public key parameters from the given encoded point.
        /// </summary>
        /// <param name="encodedPoint">The encoded point.</param>
        /// <param name="publicKeyParamSet">The public key param set.</param>
        /// <param name="hashAlgorithm">The hash algorithm.</param>
        /// <param name="symmetricKeyAlgorithm">The symmetric key algorithm.</param>
        /// <returns></returns>
        public static ECDHPublicKeyParameters Create(IBigInteger encodedPoint, DerObjectIdentifier publicKeyParamSet, 
            HashAlgorithmTag hashAlgorithm, SymmetricKeyAlgorithmTag symmetricKeyAlgorithm)
        {
            var curve = ECKeyPairGenerator.FindECCurveByOid(publicKeyParamSet);
            var point = curve.Curve.DecodePoint(encodedPoint.ToByteArrayUnsigned());

            return new ECDHPublicKeyParameters(point, publicKeyParamSet, hashAlgorithm, symmetricKeyAlgorithm);
        }
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:16,代码来源:ECDHPublicKeyParameters.cs


示例7: PbeMethod

 internal PbeMethod(
     SymmetricKeyAlgorithmTag  encAlgorithm,
     S2k                       s2k,
     KeyParameter              key)
 {
     this.encAlgorithm = encAlgorithm;
     this.s2k = s2k;
     this.key = key;
 }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:9,代码来源:PgpEncryptedDataGenerator.cs


示例8: SecretSubkeyPacket

		public SecretSubkeyPacket(
            PublicKeyPacket				pubKeyPacket,
            SymmetricKeyAlgorithmTag	encAlgorithm,
            S2k							s2k,
            byte[]						iv,
            byte[]						secKeyData)
            : base(pubKeyPacket, encAlgorithm, s2k, iv, secKeyData)
        {
        }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:9,代码来源:SecretSubkeyPacket.cs


示例9: SecretKeyPacket

 /// <summary>
 /// Initializes a new instance of the <see cref="SecretKeyPacket"/> class.
 /// </summary>
 /// <param name="pubKeyPacket">The pub key packet.</param>
 /// <param name="encAlgorithm">The enc algorithm.</param>
 /// <param name="s2KUsage">The s2 K usage.</param>
 /// <param name="s2K">The s2 K.</param>
 /// <param name="iv">The iv.</param>
 /// <param name="secKeyData">The sec key data.</param>
 public SecretKeyPacket(IPublicKeyPacket pubKeyPacket, SymmetricKeyAlgorithmTag encAlgorithm, int s2KUsage, S2k s2K, byte[] iv, byte[] secKeyData)
 {
     this.PublicKeyPacket = pubKeyPacket;
     this.EncAlgorithm = encAlgorithm;
     this.S2KUsage = s2KUsage;
     this.S2K = s2K;
     _iv = Arrays.Clone(iv);
     _secKeyData = secKeyData;
 }
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:18,代码来源:SecretKeyPacket.cs


示例10: PgpSecretKey

		internal PgpSecretKey(
			PgpPrivateKey				privKey,
			PgpPublicKey				pubKey,
			SymmetricKeyAlgorithmTag	encAlgorithm,
			char[]						passPhrase,
			bool						useSha1,
			SecureRandom				rand)
			: this(privKey, pubKey, encAlgorithm, passPhrase, useSha1, rand, false)
		{
		}
开发者ID:randombit,项目名称:hacrypto,代码行数:10,代码来源:PgpSecretKey.cs


示例11: SymmetricKeyEncSessionPacket

        public SymmetricKeyEncSessionPacket(
            BcpgInputStream bcpgIn)
        {
            version = bcpgIn.ReadByte();
            encAlgorithm = (SymmetricKeyAlgorithmTag) bcpgIn.ReadByte();

            s2k = new S2k(bcpgIn);

            secKeyData = bcpgIn.ReadAll();
        }
开发者ID:htlp,项目名称:itextsharp,代码行数:10,代码来源:SymmetricKeyEncSessionPacket.cs


示例12: ECDHPublicBcpgKey

        /// <summary>
        /// Initializes a new instance of the <see cref="ECDHPublicBcpgKey"/> class.
        /// </summary>
        /// <param name="point">The point.</param>
        /// <param name="oid">The oid.</param>
        /// <param name="hashAlgorithm">The hash algorithm.</param>
        /// <param name="symmetricKeyAlgorithm">The symmetric key algorithm.</param>
        public ECDHPublicBcpgKey(ECPoint point, DerObjectIdentifier oid, HashAlgorithmTag hashAlgorithm,
                                 SymmetricKeyAlgorithmTag symmetricKeyAlgorithm)
            : base(point, oid)
        {
            _reserved = 1;
            _hashFunctionId = (byte)hashAlgorithm;
            _symAlgorithmId = (byte)symmetricKeyAlgorithm;

            this.VerifyHashAlgorithm();
            this.VerifySymmetricKeyAlgorithm();
        }
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:18,代码来源:EcdhPublicBcpgKey.cs


示例13: PgpSecretKey

 public PgpSecretKey(
     int certificationLevel,
     PgpKeyPair keyPair,
     string id,
     SymmetricKeyAlgorithmTag encAlgorithm,
     char[] passPhrase,
     PgpSignatureSubpacketVector hashedPackets,
     PgpSignatureSubpacketVector unhashedPackets,
     ISecureRandom rand)
     : this(certificationLevel, keyPair, id, encAlgorithm, passPhrase, false, hashedPackets, unhashedPackets, rand)
 {
 }
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:12,代码来源:PgpSecretKey.cs


示例14: PgpKeyRingGenerator

		/// <summary>
		/// Create a new key ring generator using old style checksumming. It is recommended to use
		/// SHA1 checksumming where possible.
		/// </summary>
		/// <param name="certificationLevel">The certification level for keys on this ring.</param>
		/// <param name="masterKey">The master key pair.</param>
		/// <param name="id">The id to be associated with the ring.</param>
		/// <param name="encAlgorithm">The algorithm to be used to protect secret keys.</param>
		/// <param name="passPhrase">The passPhrase to be used to protect secret keys.</param>
		/// <param name="hashedPackets">Packets to be included in the certification hash.</param>
		/// <param name="unhashedPackets">Packets to be attached unhashed to the certification.</param>
		/// <param name="rand">input secured random.</param>
		public PgpKeyRingGenerator(
			int							certificationLevel,
			PgpKeyPair					masterKey,
			string						id,
			SymmetricKeyAlgorithmTag	encAlgorithm,
			char[]						passPhrase,
			PgpSignatureSubpacketVector	hashedPackets,
			PgpSignatureSubpacketVector	unhashedPackets,
			SecureRandom				rand)
			: this(certificationLevel, masterKey, id, encAlgorithm, passPhrase, false, hashedPackets, unhashedPackets, rand)
		{
		}
开发者ID:martijn00,项目名称:BouncyCastle-PCL,代码行数:24,代码来源:PgpKeyRingGenerator.cs


示例15: GetKeyEncryptionOID

 public static DerObjectIdentifier GetKeyEncryptionOID(SymmetricKeyAlgorithmTag algID)
 {
     switch (algID)
     {
     case SymmetricKeyAlgorithmTag.Aes128:
         return NistObjectIdentifiers.IdAes128Wrap;
     case SymmetricKeyAlgorithmTag.Aes192:
         return NistObjectIdentifiers.IdAes192Wrap;
     case SymmetricKeyAlgorithmTag.Aes256:
         return NistObjectIdentifiers.IdAes256Wrap;
     default:
         throw new PgpException("unknown symmetric algorithm ID: " + algID);
     }
 }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:14,代码来源:Rfc6637Utilities.cs


示例16: GetKeyLength

 public static int GetKeyLength(SymmetricKeyAlgorithmTag algID)
 {
     switch (algID)
     {
     case SymmetricKeyAlgorithmTag.Aes128:
         return 16;
     case SymmetricKeyAlgorithmTag.Aes192:
         return 24;
     case SymmetricKeyAlgorithmTag.Aes256:
         return 32;
     default:
         throw new PgpException("unknown symmetric algorithm ID: " + algID);
     }
 }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:14,代码来源:Rfc6637Utilities.cs


示例17: PgpSecretKey

        public PgpSecretKey(
			int							certificationLevel,
			PgpKeyPair					keyPair,
			string						id,
			SymmetricKeyAlgorithmTag	encAlgorithm,
			char[]						passPhrase,
			bool						useSHA1,
			PgpSignatureSubpacketVector	hashedPackets,
			PgpSignatureSubpacketVector	unhashedPackets,
			SecureRandom				rand)
            : this(keyPair, encAlgorithm, passPhrase, useSHA1, rand)
        {
            try
            {
                this.trust = null;
                this.ids = new ArrayList();
                ids.Add(id);

                this.idTrusts = new ArrayList();
                idTrusts.Add(null);

                this.idSigs = new ArrayList();

                PgpSignatureGenerator sGen = new PgpSignatureGenerator(
                    keyPair.PublicKey.Algorithm, HashAlgorithmTag.Sha1);

                //
                // Generate the certification
                //
                sGen.InitSign(certificationLevel, keyPair.PrivateKey);

                sGen.SetHashedSubpackets(hashedPackets);
                sGen.SetUnhashedSubpackets(unhashedPackets);

                PgpSignature certification = sGen.GenerateCertification(id, keyPair.PublicKey);
                this.pub = PgpPublicKey.AddCertification(keyPair.PublicKey, id, certification);

                ArrayList sigList = new ArrayList();
                sigList.Add(certification);
                idSigs.Add(sigList);
            }
            catch (PgpException e)
            {
                throw e;
            }
            catch (Exception e)
            {
                throw new PgpException("Exception encrypting key", e);
            }
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:50,代码来源:PgpSecretKey.cs


示例18: ECDHPublicBcpgKey

        public ECDHPublicBcpgKey(
            DerObjectIdentifier oid,
            ECPoint point,
            HashAlgorithmTag hashAlgorithm,
            SymmetricKeyAlgorithmTag symmetricKeyAlgorithm)
            : base(oid, point)
        {
            reserved = 1;
            hashFunctionId = hashAlgorithm;
            symAlgorithmId = symmetricKeyAlgorithm;

            VerifyHashAlgorithm();
            VerifySymmetricKeyAlgorithm();
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:14,代码来源:ECDHPublicBCPGKey.cs


示例19: SecretKeyPacket

		public SecretKeyPacket(
            PublicKeyPacket				pubKeyPacket,
            SymmetricKeyAlgorithmTag	encAlgorithm,
            S2k							s2k,
            byte[]						iv,
            byte[]						secKeyData)
        {
            this.pubKeyPacket = pubKeyPacket;
            this.encAlgorithm = encAlgorithm;

			if (encAlgorithm != SymmetricKeyAlgorithmTag.Null)
			{
				this.s2kUsage = UsageChecksum;
			}
			else
			{
				this.s2kUsage = UsageNone;
			}

			this.s2k = s2k;
			this.iv = Arrays.Clone(iv);
			this.secKeyData = secKeyData;
        }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:23,代码来源:SecretKeyPacket.cs


示例20: GetSymmetricCipherName

		public static string GetSymmetricCipherName(
            SymmetricKeyAlgorithmTag algorithm)
        {
            switch (algorithm)
            {
				case SymmetricKeyAlgorithmTag.Null:
					return null;
				case SymmetricKeyAlgorithmTag.TripleDes:
					return "DESEDE";
				case SymmetricKeyAlgorithmTag.Idea:
					return "IDEA";
				case SymmetricKeyAlgorithmTag.Cast5:
					return "CAST5";
				case SymmetricKeyAlgorithmTag.Blowfish:
					return "Blowfish";
				case SymmetricKeyAlgorithmTag.Safer:
					return "SAFER";
				case SymmetricKeyAlgorithmTag.Des:
					return "DES";
				case SymmetricKeyAlgorithmTag.Aes128:
					return "AES";
				case SymmetricKeyAlgorithmTag.Aes192:
					return "AES";
				case SymmetricKeyAlgorithmTag.Aes256:
					return "AES";
				case SymmetricKeyAlgorithmTag.Twofish:
					return "Twofish";
				default:
					throw new PgpException("unknown symmetric algorithm: " + algorithm);
            }
        }
开发者ID:pusp,项目名称:o2platform,代码行数:31,代码来源:PgpUtilities.cs



注:本文中的SymmetricKeyAlgorithmTag类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SymmetricKeyIssuerNameRegistry类代码示例发布时间:2022-05-24
下一篇:
C# SymbolType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap