本文整理汇总了C#中Org.BouncyCastle.Bcpg.BcpgOutputStream.WriteObject方法的典型用法代码示例。如果您正苦于以下问题:C# BcpgOutputStream.WriteObject方法的具体用法?C# BcpgOutputStream.WriteObject怎么用?C# BcpgOutputStream.WriteObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Org.BouncyCastle.Bcpg.BcpgOutputStream
的用法示例。
在下文中一共展示了BcpgOutputStream.WriteObject方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
byte[] oid = this.oid.GetEncoded();
bcpgOut.Write(oid, 1, oid.Length - 1);
MPInteger point = new MPInteger(this.point);
bcpgOut.WriteObject(point);
}
示例2: GetEncoded
public virtual byte[] GetEncoded()
{
MemoryStream bOut = new MemoryStream();
BcpgOutputStream pOut = new BcpgOutputStream(bOut);
pOut.WriteObject(this);
return bOut.ToArray();
}
示例3: GetEncoded
public byte[] GetEncoded()
{
try
{
using (var bOut = new MemoryStream())
{
using (var pOut = new BcpgOutputStream(bOut))
{
pOut.WriteObject(this);
return bOut.ToArray();
}
}
}
catch (Exception)
{
return null;
}
}
示例4: 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);
}
示例5: Encode
public override void Encode(
BcpgOutputStream bcpgOut)
{
bcpgOut.WriteObject(x);
}
示例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: GetSignatureBytes
/**
* Return the byte encoding of the signature section.
* @return uninterpreted signature bytes.
*/
public byte[] GetSignatureBytes()
{
if (signatureEncoding != null)
{
return (byte[]) signatureEncoding.Clone();
}
MemoryStream bOut = new MemoryStream();
BcpgOutputStream bcOut = new BcpgOutputStream(bOut);
foreach (MPInteger sigObj in signature)
{
try
{
bcOut.WriteObject(sigObj);
}
catch (IOException e)
{
throw new Exception("internal error: " + e);
}
}
return bOut.ToArray();
}
示例8: GetEncodedContents
public byte[] GetEncodedContents()
{
MemoryStream bOut = new MemoryStream();
BcpgOutputStream pOut = new BcpgOutputStream(bOut);
pOut.Write(pubKeyPacket.GetEncodedContents());
pOut.WriteByte((byte) s2kUsage);
if (s2kUsage == UsageChecksum || s2kUsage == UsageSha1)
{
pOut.WriteByte((byte) encAlgorithm);
pOut.WriteObject(s2k);
}
if (iv != null)
{
pOut.Write(iv);
}
if (secKeyData != null && secKeyData.Length > 0)
{
pOut.Write(secKeyData);
}
return bOut.ToArray();
}
示例9: GetEncodedContents
public byte[] GetEncodedContents()
{
MemoryStream bOut = new MemoryStream();
BcpgOutputStream pOut = new BcpgOutputStream(bOut);
pOut.WriteByte((byte) version);
pOut.WriteInt((int) time);
if (version <= 3)
{
pOut.WriteShort((short) validDays);
}
pOut.WriteByte((byte) algorithm);
pOut.WriteObject((BcpgObject)key);
return bOut.ToArray();
}
示例10: Encode
/// <summary>
/// Encodes this instance to the given stream.
/// </summary>
/// <param name="bcpgOut">The BCPG out.</param>
public override void Encode(IBcpgOutputStream bcpgOut)
{
using (var bOut = new MemoryStream())
{
using (var 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);
}
}
}
示例11: GetSignatureBytes
/**
* Return the byte encoding of the signature section.
* @return uninterpreted signature bytes.
*/
public byte[] GetSignatureBytes()
{
if (_signatureEncoding != null)
{
return (byte[])_signatureEncoding.Clone();
}
using (var bOut = new MemoryStream())
{
using (var bcOut = new BcpgOutputStream(bOut))
{
foreach (var sigObj in _signature)
{
try
{
bcOut.WriteObject(sigObj);
}
catch (IOException e)
{
throw new Exception("internal error: " + e);
}
}
}
return bOut.ToArray();
}
}
示例12: GetEncodedContents
/// <summary>
/// Gets the encoded contents.
/// </summary>
/// <returns></returns>
public byte[] GetEncodedContents()
{
using (var bOut = new MemoryStream())
{
using (var pOut = new BcpgOutputStream(bOut))
{
pOut.WriteByte((byte)_version);
pOut.WriteInt((int)_time);
if (_version <= 3)
{
pOut.WriteShort((short)_validDays);
}
pOut.WriteByte((byte)_algorithm);
pOut.WriteObject((BcpgObject)_key);
return bOut.ToArray();
}
}
}
示例13: GetEncodedContents
/// <summary>
/// Gets the encoded contents.
/// </summary>
/// <returns></returns>
public byte[] GetEncodedContents()
{
using (var bOut = new MemoryStream())
{
using (var pOut = new BcpgOutputStream(bOut))
{
pOut.Write(PublicKeyPacket.GetEncodedContents());
pOut.WriteByte((byte) this.S2KUsage);
if (this.S2KUsage == UsageChecksum || this.S2KUsage == UsageSha1)
{
pOut.WriteByte((byte)this.EncAlgorithm);
pOut.WriteObject(this.S2K);
}
if (_iv != null)
{
pOut.Write(_iv);
}
if (_secKeyData != null && _secKeyData.Length > 0)
{
pOut.Write(_secKeyData);
}
return bOut.ToArray();
}
}
}