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


C# BcpgOutputStream.WriteObjects方法代码示例

本文整理汇总了C#中Org.BouncyCastle.Bcpg.BcpgOutputStream.WriteObjects方法的典型用法代码示例。如果您正苦于以下问题:C# BcpgOutputStream.WriteObjects方法的具体用法?C# BcpgOutputStream.WriteObjects怎么用?C# BcpgOutputStream.WriteObjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Org.BouncyCastle.Bcpg.BcpgOutputStream的用法示例。


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

示例1: Encode

		public override void Encode(
            BcpgOutputStream bcpgOut)
        {
            MemoryStream bOut = new MemoryStream();
            BcpgOutputStream pOut = new BcpgOutputStream(bOut);

			pOut.WriteByte((byte) version);

			if (version == 3 || version == 2)
            {
				pOut.Write(
					5, // the length of the next block
					(byte) signatureType);

				pOut.WriteInt((int)(creationTime / 1000L));

				pOut.WriteLong(keyId);

				pOut.Write(
					(byte) keyAlgorithm,
					(byte) hashAlgorithm);
            }
            else if (version == 4)
            {
                pOut.Write(
					(byte) signatureType,
					(byte) keyAlgorithm,
					(byte) hashAlgorithm);

				EncodeLengthAndData(pOut, GetEncodedSubpackets(hashedData));

				EncodeLengthAndData(pOut, GetEncodedSubpackets(unhashedData));
            }
            else
            {
                throw new IOException("unknown version: " + version);
            }

			pOut.Write(fingerprint);

			if (signature != null)
			{
				pOut.WriteObjects(signature);
			}
			else
			{
				pOut.Write(signatureEncoding);
			}

			bcpgOut.WritePacket(PacketTag.Signature, bOut.ToArray(), true);
        }
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:51,代码来源:SignaturePacket.cs

示例2: Encode

		public override void Encode(
			BcpgOutputStream bcpgOut)
		{
			bcpgOut.WriteObjects(p, g, y);
		}
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:5,代码来源:ElGamalPublicBcpgKey.cs

示例3: Encode

        public override void Encode(
			BcpgOutputStream bcpgOut)
        {
            bcpgOut.WriteObjects(d, p, q, u);
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:5,代码来源:RsaSecretBcpgKey.cs

示例4: Encode

        public override void Encode(IBcpgOutputStream bcpgOut)
        {
            using (var bOut = new MemoryStream())
            {
                using (var pOut = new BcpgOutputStream(bOut))
                {

                    pOut.WriteByte((byte)_version);

                    switch (_version)
                    {
                        case 2:
                        case 3:
                            pOut.Write(
                                5, // the length of the next block
                                (byte)_signatureType);
                            pOut.WriteInt((int)(CreationTime / 1000L));
                            pOut.WriteLong(_keyId);
                            pOut.Write(
                                (byte)_keyAlgorithm,
                                (byte)_hashAlgorithm);
                            break;
                        case 4:
                            pOut.Write(
                                (byte)_signatureType,
                                (byte)_keyAlgorithm,
                                (byte)_hashAlgorithm);
                            EncodeLengthAndData(pOut, GetEncodedSubpackets(_hashedData));
                            EncodeLengthAndData(pOut, GetEncodedSubpackets(_unhashedData));
                            break;
                        default:
                            throw new IOException("unknown version: " + _version);
                    }

                    pOut.Write(_fingerprint);

                    if (_signature != null)
                    {
                        pOut.WriteObjects(_signature);
                    }
                    else
                    {
                        pOut.Write(_signatureEncoding);
                    }

                    bcpgOut.WritePacket(PacketTag.Signature, bOut.ToArray(), true);
                }
            }
        }
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:49,代码来源:SignaturePacket.cs


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