本文整理汇总了C#中Org.BouncyCastle.Bcpg.BcpgOutputStream.WritePacket方法的典型用法代码示例。如果您正苦于以下问题:C# BcpgOutputStream.WritePacket方法的具体用法?C# BcpgOutputStream.WritePacket怎么用?C# BcpgOutputStream.WritePacket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Org.BouncyCastle.Bcpg.BcpgOutputStream
的用法示例。
在下文中一共展示了BcpgOutputStream.WritePacket方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetEncoded
public byte[] GetEncoded()
{
MemoryStream bOut = new MemoryStream();
BcpgOutputStream pOut = new BcpgOutputStream(bOut);
pOut.WritePacket(this);
return bOut.ToArray();
}
示例2: GetEncoded
/// <summary>
/// Gets the encoded version of this instance.
/// </summary>
/// <returns></returns>
public byte[] GetEncoded()
{
using (var bOut = new MemoryStream())
{
using (var pOut = new BcpgOutputStream(bOut))
{
pOut.WritePacket(this);
return bOut.ToArray();
}
}
}
示例3: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
MemoryStream bOut = new MemoryStream();
for (int i = 0; i != subpackets.Length; i++)
{
subpackets[i].Encode(bOut);
}
bcpgOut.WritePacket(PacketTag.UserAttribute, bOut.ToArray(), false);
}
示例4: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
bcpgOut.WritePacket(PacketTag.UserId, idData, true);
}
示例5: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
bcpgOut.WritePacket(tag, contents, true);
}
示例6: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
MemoryStream bOut = new MemoryStream();
BcpgOutputStream pOut = new BcpgOutputStream(bOut);
pOut.WriteByte((byte) version);
pOut.WriteLong(keyId);
pOut.WriteByte((byte)algorithm);
for (int i = 0; i != data.Length; i++)
{
pOut.WriteObject(new MPInteger(data[i]));
}
bcpgOut.WritePacket(PacketTag.PublicKeyEncryptedSession , bOut.ToArray(), true);
}
示例7: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
bcpgOut.WritePacket(PacketTag.ModificationDetectionCode, digest, false);
}
示例8: 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);
}
示例9: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
MemoryStream bOut = new MemoryStream();
BcpgOutputStream pOut = new BcpgOutputStream(bOut);
pOut.Write(
(byte) version,
(byte) encAlgorithm);
pOut.WriteObject(s2k);
if (secKeyData != null && secKeyData.Length > 0)
{
pOut.Write(secKeyData);
}
bcpgOut.WritePacket(PacketTag.SymmetricKeyEncryptedSessionKey, bOut.ToArray(), true);
}
示例10: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
bcpgOut.WritePacket(PacketTag.SecretSubkey, GetEncodedContents(), true);
}
示例11: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
MemoryStream bOut = new MemoryStream();
BcpgOutputStream pOut = new BcpgOutputStream(bOut);
pOut.Write(
(byte) version,
(byte) sigType,
(byte) hashAlgorithm,
(byte) keyAlgorithm);
pOut.WriteLong(keyId);
pOut.WriteByte((byte) nested);
bcpgOut.WritePacket(PacketTag.OnePassSignature, bOut.ToArray(), true);
}
示例12: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
MemoryStream bOut = new MemoryStream();
BcpgOutputStream pOut = new BcpgOutputStream(bOut);
pOut.WriteByte((byte) version);
pOut.WriteLong(keyId);
pOut.WriteByte((byte)algorithm);
for (int i = 0; i < data.Length; ++i)
{
pOut.Write(data[i]);
}
Platform.Dispose(pOut);
bcpgOut.WritePacket(PacketTag.PublicKeyEncryptedSession , bOut.ToArray(), true);
}
示例13: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
bcpgOut.WritePacket(PacketTag.Marker, marker, true);
}
示例14: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
bcpgOut.WritePacket(PacketTag.Trust, levelAndTrustAmount, true);
}