本文整理匯總了C#中Org.BouncyCastle.Asn1.DerOutputStream.WriteByte方法的典型用法代碼示例。如果您正苦於以下問題:C# DerOutputStream.WriteByte方法的具體用法?C# DerOutputStream.WriteByte怎麽用?C# DerOutputStream.WriteByte使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Org.BouncyCastle.Asn1.DerOutputStream
的用法示例。
在下文中一共展示了DerOutputStream.WriteByte方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Encode
internal override void Encode(
DerOutputStream derOut)
{
if (derOut is Asn1OutputStream || derOut is BerOutputStream)
{
derOut.WriteByte(Asn1Tags.Constructed | Asn1Tags.OctetString);
derOut.WriteByte(0x80);
//
// write out the octet array
//
foreach (DerOctetString oct in this)
{
derOut.WriteObject(oct);
}
derOut.WriteByte(0x00);
derOut.WriteByte(0x00);
}
else
{
base.Encode(derOut);
}
}
示例2: Encode
internal override void Encode(
DerOutputStream derOut)
{
if (derOut is Asn1OutputStream || derOut is BerOutputStream)
{
derOut.WriteByte((byte)(Asn1Tags.Constructed | Asn1Tags.Tagged | tagNo));
derOut.WriteByte(0x80);
if (!IsEmpty())
{
if (!explicitly)
{
IEnumerable eObj;
if (obj is Asn1OctetString)
{
if (obj is BerOctetString)
{
eObj = (BerOctetString) obj;
}
else
{
Asn1OctetString octs = (Asn1OctetString)obj;
eObj = new BerOctetString(octs.GetOctets());
}
}
else if (obj is Asn1Sequence)
{
eObj = (Asn1Sequence) obj;
}
else if (obj is Asn1Set)
{
eObj = (Asn1Set) obj;
}
else
{
throw new NotImplementedException("not implemented: " + obj.GetType().Name);
}
foreach (object o in eObj)
{
derOut.WriteObject(o);
}
}
else
{
derOut.WriteObject(obj);
}
}
derOut.WriteByte(0x00);
derOut.WriteByte(0x00);
}
else
{
base.Encode(derOut);
}
}
示例3: Encode
internal override void Encode(
DerOutputStream derOut)
{
if (derOut is Asn1OutputStream || derOut is BerOutputStream)
{
derOut.WriteByte(Asn1Tags.Constructed | Asn1Tags.OctetString);
derOut.WriteByte(0x80);
//
// write out the octet array
//
if (octs != null)
{
for (int i = 0; i != octs.Count; i++)
{
derOut.WriteObject(octs[i]);
}
}
else
{
for (int i = 0; i < str.Length; i += MaxLength)
{
int end = System.Math.Min(str.Length, i + MaxLength);
byte[] nStr = new byte[end - i];
Array.Copy(str, i, nStr, 0, nStr.Length);
derOut.WriteObject(new DerOctetString(nStr));
}
}
derOut.WriteByte(0x00);
derOut.WriteByte(0x00);
}
else
{
base.Encode(derOut);
}
}
示例4: Encode
internal override void Encode(
DerOutputStream derOut)
{
if (derOut is Asn1OutputStream || derOut is BerOutputStream)
{
derOut.WriteByte(Asn1Tags.Null);
}
else
{
base.Encode(derOut);
}
}