当前位置: 首页>>代码示例>>C#>>正文


C# SymmetricKeyAlgorithmTag类代码示例

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


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


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