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


C# IAsymmetricBlockCipher类代码示例

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


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

示例1: GenericSigner

        public GenericSigner(
			IAsymmetricBlockCipher	engine,
			IDigest					digest)
        {
            this.engine = engine;
            this.digest = digest;
        }
开发者ID:Noyabronok,项目名称:itextsharpml,代码行数:7,代码来源:GenericSigner.cs

示例2: Iso9796d2PssSigner

		/// <summary>
		/// Generate a signer for the with either implicit or explicit trailers
		/// for ISO9796-2, scheme 2 or 3.
		/// </summary>
		/// <param name="cipher">base cipher to use for signature creation/verification</param>
		/// <param name="digest">digest to use.</param>
		/// <param name="saltLength">length of salt in bytes.</param>
		/// <param name="isImplicit">whether or not the trailer is implicit or gives the hash.</param>
		public Iso9796d2PssSigner(
			IAsymmetricBlockCipher	cipher,
			IDigest					digest,
			int						saltLength,
			bool					isImplicit)
		{
			this.cipher = cipher;
			this.digest = digest;
			this.hLen = digest.GetDigestSize();
			this.saltLength = saltLength;

			if (isImplicit)
			{
				trailer = TrailerImplicit;
			}
			else
			{
				if (digest is Sha1Digest)
				{
					trailer = TrailerSha1;
				}
				else if (digest is RipeMD160Digest)
				{
					trailer = TrailerRipeMD160;
				}
				else if (digest is RipeMD128Digest)
				{
					trailer = TrailerRipeMD128;
				}
				else
				{
					throw new ArgumentException("no valid trailer for digest");
				}
			}
		}
开发者ID:kungfubozo,项目名称:Bouncy-Castle-WP8,代码行数:43,代码来源:Iso9796d2PssSigner.cs

示例3: OaepEncoding

 public OaepEncoding(
     IAsymmetricBlockCipher	cipher,
     IDigest					hash,
     byte[]					encodingParams)
     : this(cipher, hash, hash, encodingParams)
 {
 }
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:7,代码来源:OaepEncoding.cs

示例4: Iso9796d2Signer

		/// <summary>
		/// Generate a signer for the with either implicit or explicit trailers
		/// for ISO9796-2.
		/// </summary>
		/// <param name="cipher">base cipher to use for signature creation/verification</param>
		/// <param name="digest">digest to use.</param>
		/// <param name="isImplicit">whether or not the trailer is implicit or gives the hash.</param>
		public Iso9796d2Signer(
			IAsymmetricBlockCipher	cipher,
			IDigest					digest,
			bool					isImplicit)
		{
			this.cipher = cipher;
			this.digest = digest;

			if (isImplicit)
			{
				trailer = TrailerImplicit;
			}
			else
			{
				if (digest is Sha1Digest)
				{
					trailer = TrailerSha1;
				}
				else if (digest is RipeMD160Digest)
				{
					trailer = TrailerRipeMD160;
				}
				else if (digest is RipeMD128Digest)
				{
					trailer = TrailerRipeMD128;
				}
				else
				{
					throw new System.ArgumentException("no valid trailer for digest");
				}
			}
		}
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:39,代码来源:Iso9796d2Signer.cs

示例5: PssSigner

 /// <summary>Basic constructor</summary>
 /// <param name="cipher">the asymmetric cipher to use.</param>
 /// <param name="digest">the digest to use.</param>
 /// <param name="salt">the fixed salt to be used.</param>
 public PssSigner(
     IAsymmetricBlockCipher cipher,
     IDigest digest,
     byte[] salt)
     : this(cipher, digest, digest, digest, salt.Length, salt, TrailerImplicit)
 {
 }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:11,代码来源:PssSigner.cs

示例6: Iso9796d2Signer

        /// <summary>
        /// Generate a signer for the with either implicit or explicit trailers
        /// for ISO9796-2.
        /// </summary>
        /// <param name="cipher">base cipher to use for signature creation/verification</param>
        /// <param name="digest">digest to use.</param>
        /// <param name="isImplicit">whether or not the trailer is implicit or gives the hash.</param>
        public Iso9796d2Signer(
            IAsymmetricBlockCipher	cipher,
            IDigest					digest,
            bool					isImplicit)
        {
            this.cipher = cipher;
            this.digest = digest;

            if (isImplicit)
            {
                trailer = TrailerImplicit;
            }
            else
            {
                string digestName = digest.AlgorithmName;

                if (trailerMap.Contains(digestName))
                {
                    trailer = (int)trailerMap[digest.AlgorithmName];
                }
                else
                {
                    throw new System.ArgumentException("no valid trailer for digest");
                }
            }
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:33,代码来源:Iso9796d2Signer.cs

示例7: Pkcs1Encoding

 /**
  * Constructor for decryption with a fixed plaintext length and a fallback
  * value that is returned, if the padding is incorrect.
  *
  * @param cipher
  *            The cipher to use for cryptographic operation.
  * @param fallback
  *            The fallback value, we don't to a arraycopy here.
  */
 public Pkcs1Encoding(IAsymmetricBlockCipher cipher, byte[] fallback)
 {
     this.engine = cipher;
     this.useStrictLength = StrictLengthEnabled;
     this.fallback = fallback;
     this.pLen = fallback.Length;
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:16,代码来源:Pkcs1Encoding.cs

示例8: PssSigner

		/// <summary>Basic constructor</summary>
		/// <param name="cipher">the asymmetric cipher to use.</param>
		/// <param name="digest">the digest to use.</param>
		/// <param name="saltLen">the length of the salt to use (in bytes).</param>
		public PssSigner(
			IAsymmetricBlockCipher	cipher,
			IDigest					digest,
			int						saltLen)
			: this(cipher, digest, saltLen, TrailerImplicit)
		{
		}
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:11,代码来源:PssSigner.cs

示例9: AsymmetricStream

 /// <summary>
 /// Initializes a new instance of the <see cref="AsymmetricStream"/> class.
 /// </summary>
 /// <param name="cipher">The cipher.</param>
 /// <param name="output">The output.</param>
 /// <param name="initFunc">The init func.</param>
 /// <param name="encrypt">if set to <c>true</c> [encrypt].</param>
 public AsymmetricStream(IAsymmetricBlockCipher cipher, Stream output, Action<IBufferedCipher, bool> initFunc,
                         bool encrypt)
 {
     _cipher = new BufferedAsymmetricBlockCipher(cipher);
     _output = output;
     _initFunc = initFunc;
     _encrypt = encrypt;
 }
开发者ID:jbtule,项目名称:keyczar-dotnet,代码行数:15,代码来源:AsymmetricStream.cs

示例10: CreateRawSigner

		public static PssSigner CreateRawSigner(
			IAsymmetricBlockCipher	cipher,
			IDigest					contentDigest,
			IDigest					mgfDigest,
			int						saltLen,
			byte					trailer)
		{
			return new PssSigner(cipher, new NullDigest(), contentDigest, mgfDigest, saltLen, trailer);
		}
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:9,代码来源:PssSigner.cs

示例11: PssSigner

 public PssSigner(
     IAsymmetricBlockCipher	cipher,
     IDigest					contentDigest,
     IDigest					mgfDigest,
     int						saltLen,
     byte					trailer)
     : this(cipher, contentDigest, contentDigest, mgfDigest, saltLen, trailer)
 {
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:9,代码来源:PssSigner.cs

示例12: PssSigner

 private PssSigner(IAsymmetricBlockCipher cipher, IDigest contentDigest1, IDigest contentDigest2, IDigest mgfDigest, int saltLen, byte trailer)
 {
     _cipher = cipher;
     _contentDigest1 = contentDigest1;
     _contentDigest2 = contentDigest2;
     _mgfDigest = mgfDigest;
     _hLen = contentDigest2.GetDigestSize();
     _mgfhLen = mgfDigest.GetDigestSize();
     _sLen = saltLen;
     _salt = new byte[saltLen];
     _mDash = new byte[8 + saltLen + _hLen];
     _trailer = trailer;
 }
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:13,代码来源:PssSigner.cs

示例13: PssSigner

        public PssSigner(
			IAsymmetricBlockCipher	cipher,
			IDigest					digest,
			int						saltLen,
			byte					trailer)
        {
            this.cipher = cipher;
            this.digest = digest;
            this.hLen = digest.GetDigestSize();
            this.sLen = saltLen;
            this.salt = new byte[saltLen];
            this.mDash = new byte[8 + saltLen + hLen];
            this.trailer = trailer;
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:14,代码来源:PssSigner.cs

示例14: OaepEncoding

        public OaepEncoding(IAsymmetricBlockCipher cipher, IDigest hash, IDigest mgf1Hash, byte[] encodingParams)
        {
            _engine = cipher;
            _hash = hash;
            _mgf1Hash = mgf1Hash;
            _defHash = new byte[hash.GetDigestSize()];

            if (encodingParams != null)
            {
                hash.BlockUpdate(encodingParams, 0, encodingParams.Length);
            }

            hash.DoFinal(_defHash, 0);
        }
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:14,代码来源:OaepEncoding.cs

示例15: X931Signer

        /**
         * Generate a signer with either implicit or explicit trailers for X9.31.
         *
         * @param cipher base cipher to use for signature creation/verification
         * @param digest digest to use.
         * @param implicit whether or not the trailer is implicit or gives the hash.
         */
        public X931Signer(IAsymmetricBlockCipher cipher, IDigest digest, bool isImplicit)
        {
            this.cipher = cipher;
            this.digest = digest;

            if (isImplicit)
            {
                trailer = IsoTrailers.TRAILER_IMPLICIT;
            }
            else if (IsoTrailers.NoTrailerAvailable(digest))
            {
                throw new ArgumentException("no valid trailer", "digest");
            }
            else
            {
                trailer = IsoTrailers.GetTrailer(digest);
            }
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:25,代码来源:X931Signer.cs


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