當前位置: 首頁>>代碼示例>>C#>>正文


C# DerOutputStream.WriteByte方法代碼示例

本文整理匯總了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);
            }
        }
開發者ID:Noyabronok,項目名稱:itextsharpml,代碼行數:25,代碼來源:BerOctetString.cs

示例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);
            }
        }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:57,代碼來源:BerTaggedObject.cs

示例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);
            }
        }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:41,代碼來源:BerOctetString.cs

示例4: Encode

		internal override void Encode(
			DerOutputStream  derOut)
		{
			if (derOut is Asn1OutputStream || derOut is BerOutputStream)
			{
				derOut.WriteByte(Asn1Tags.Null);
			}
			else
			{
				base.Encode(derOut);
			}
		}
開發者ID:htlp,項目名稱:itextsharp,代碼行數:12,代碼來源:BerNull.cs


注:本文中的Org.BouncyCastle.Asn1.DerOutputStream.WriteByte方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。