• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DerBitString类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DerBitString的典型用法代码示例。如果您正苦于以下问题:C# DerBitString类的具体用法?C# DerBitString怎么用?C# DerBitString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DerBitString类属于命名空间,在下文中一共展示了DerBitString类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PkiStatusInfo

        public PkiStatusInfo(
			Asn1Sequence seq)
        {
            this.status = DerInteger.GetInstance(seq[0]);

            this.statusString = null;
            this.failInfo = null;

            if (seq.Count > 2)
            {
                this.statusString = PkiFreeText.GetInstance(seq[1]);
                this.failInfo = DerBitString.GetInstance(seq[2]);
            }
            else if (seq.Count > 1)
            {
                object obj = seq[1];
                if (obj is DerBitString)
                {
                    this.failInfo = DerBitString.GetInstance(obj);
                }
                else
                {
                    this.statusString = PkiFreeText.GetInstance(obj);
                }
            }
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:26,代码来源:PKIStatusInfo.cs


示例2: PkiMessage

 public PkiMessage(
     PkiHeader header,
     PkiBody body,
     DerBitString protection)
     : this(header, body, protection, null)
 {
 }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:7,代码来源:PKIMessage.cs


示例3: SubjectPublicKeyInfo

		public SubjectPublicKeyInfo(
            AlgorithmIdentifier	algID,
            Asn1Encodable		publicKey)
        {
            this.keyData = new DerBitString(publicKey);
            this.algID = algID;
        }
开发者ID:pusp,项目名称:o2platform,代码行数:7,代码来源:SubjectPublicKeyInfo.cs


示例4: EncryptedValue

        private EncryptedValue(Asn1Sequence seq)
        {
            int index = 0;
            while (seq[index] is Asn1TaggedObject)
            {
                Asn1TaggedObject tObj = (Asn1TaggedObject)seq[index];

                switch (tObj.TagNo)
                {
                    case 0:
                        intendedAlg = AlgorithmIdentifier.GetInstance(tObj, false);
                        break;
                    case 1:
                        symmAlg = AlgorithmIdentifier.GetInstance(tObj, false);
                        break;
                    case 2:
                        encSymmKey = DerBitString.GetInstance(tObj, false);
                        break;
                    case 3:
                        keyAlg = AlgorithmIdentifier.GetInstance(tObj, false);
                        break;
                    case 4:
                        valueHint = Asn1OctetString.GetInstance(tObj, false);
                        break;
                }
                ++index;
            }

            encValue = DerBitString.GetInstance(seq[index]);
        }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:30,代码来源:EncryptedValue.cs


示例5: OriginatorPublicKey

 public OriginatorPublicKey(
     AlgorithmIdentifier algorithm,
     byte[]              publicKey)
 {
     this.mAlgorithm = algorithm;
     this.mPublicKey = new DerBitString(publicKey);
 }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:7,代码来源:OriginatorPublicKey.cs


示例6: AttributeCertificateInfo

		private AttributeCertificateInfo(
            Asn1Sequence seq)
        {
			if (seq.Count < 7 || seq.Count > 9)
			{
				throw new ArgumentException("Bad sequence size: " + seq.Count);
			}

			this.version = DerInteger.GetInstance(seq[0]);
            this.holder = Holder.GetInstance(seq[1]);
            this.issuer = AttCertIssuer.GetInstance(seq[2]);
            this.signature = AlgorithmIdentifier.GetInstance(seq[3]);
            this.serialNumber = DerInteger.GetInstance(seq[4]);
            this.attrCertValidityPeriod = AttCertValidityPeriod.GetInstance(seq[5]);
            this.attributes = Asn1Sequence.GetInstance(seq[6]);

			for (int i = 7; i < seq.Count; i++)
            {
                Asn1Encodable obj = (Asn1Encodable) seq[i];

				if (obj is DerBitString)
                {
                    this.issuerUniqueID = DerBitString.GetInstance(seq[i]);
                }
                else if (obj is Asn1Sequence || obj is X509Extensions)
                {
                    this.extensions = X509Extensions.GetInstance(seq[i]);
                }
            }
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:30,代码来源:AttributeCertificateInfo.cs


示例7: PKMacValue

 /**
  * Creates a new PKMACValue.
  * @param aid CMPObjectIdentifiers.passwordBasedMAC, with PBMParameter
  * @param value MAC of the DER-encoded SubjectPublicKeyInfo
  */
 public PKMacValue(
     AlgorithmIdentifier algID,
     DerBitString        macValue)
 {
     this.algID = algID;
     this.macValue = macValue;
 }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:12,代码来源:PKMacValue.cs


示例8: DHValidationParms

		private DHValidationParms(Asn1Sequence seq)
		{
			if (seq.Count != 2)
				throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");

			this.seed = DerBitString.GetInstance(seq[0]);
			this.pgenCounter = DerInteger.GetInstance(seq[1]);
		}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:8,代码来源:DHValidationParms.cs


示例9: CertificationRequest

 public CertificationRequest(
     CertificationRequestInfo	requestInfo,
     AlgorithmIdentifier			algorithm,
     DerBitString				signature)
 {
     this.reqInfo = requestInfo;
     this.sigAlgId = algorithm;
     this.sigBits = signature;
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:9,代码来源:CertificationRequest.cs


示例10: PopoSigningKey

 /**
  * Creates a new Proof of Possession object for a signing key.
  * @param poposkIn the PopoSigningKeyInput structure, or null if the
  *     CertTemplate includes both subject and publicKey values.
  * @param aid the AlgorithmIdentifier used to sign the proof of possession.
  * @param signature a signature over the DER-encoded value of poposkIn,
  *     or the DER-encoded value of certReq if poposkIn is null.
  */
 public PopoSigningKey(
     PopoSigningKeyInput poposkIn,
     AlgorithmIdentifier aid,
     DerBitString signature)
 {
     this.poposkInput = poposkIn;
     this.algorithmIdentifier = aid;
     this.signature = signature;
 }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:17,代码来源:PopoSigningKey.cs


示例11: Signature

		private Signature(
            Asn1Sequence seq)
        {
            signatureAlgorithm = AlgorithmIdentifier.GetInstance(seq[0]);
            signatureValue = (DerBitString)seq[1];

			if (seq.Count == 3)
            {
                certs = Asn1Sequence.GetInstance(
					(Asn1TaggedObject)seq[2], true);
            }
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:12,代码来源:Signature.cs


示例12: X509CertificateStructure

        private X509CertificateStructure(
            Asn1Sequence seq)
        {
            if (seq.Count != 3)
                throw new ArgumentException("sequence wrong size for a certificate", "seq");

            //
            // correct x509 certficate
            //
            tbsCert = TbsCertificateStructure.GetInstance(seq[0]);
            sigAlgID = AlgorithmIdentifier.GetInstance(seq[1]);
            sig = DerBitString.GetInstance(seq[2]);
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:13,代码来源:X509CertificateStructure.cs


示例13: DoTestZeroLengthStrings

        private void DoTestZeroLengthStrings()
        {
            // basic construction
            DerBitString s1 = new DerBitString(new byte[0], 0);

            // check GetBytes()
            s1.GetBytes();

            // check encoding/decoding
            DerBitString derBit = (DerBitString)Asn1Object.FromByteArray(s1.GetEncoded());

            if (!Arrays.AreEqual(s1.GetEncoded(), Hex.Decode("030100")))
            {
                Fail("zero encoding wrong");
            }

            try
            {
                new DerBitString(null, 1);
                Fail("exception not thrown");
            }
            catch (ArgumentNullException)
            {
            }

            try
            {
                new DerBitString(new byte[0], 1);
                Fail("exception not thrown");
            }
            catch (ArgumentException)
            {
            }

            try
            {
                new DerBitString(new byte[1], 8);
                Fail("exception not thrown");
            }
            catch (ArgumentException)
            {
            }

            DerBitString s2 = new DerBitString(0);
            if (!Arrays.AreEqual(s1.GetEncoded(), s2.GetEncoded()))
            {
                Fail("zero encoding wrong");
            }
        }
开发者ID:bcgit,项目名称:bc-csharp,代码行数:49,代码来源:BitStringTest.cs


示例14: IssuerSerial

		private IssuerSerial(
            Asn1Sequence seq)
        {
			if (seq.Count != 2 && seq.Count != 3)
			{
				throw new ArgumentException("Bad sequence size: " + seq.Count);
			}

			issuer = GeneralNames.GetInstance(seq[0]);
			serial = DerInteger.GetInstance(seq[1]);

			if (seq.Count == 3)
            {
				issuerUid = DerBitString.GetInstance(seq[2]);
			}
        }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:16,代码来源:IssuerSerial.cs


示例15: ObjectDigestInfo

        /**
         * Constructor from given details.
         * <p>
         * If <code>digestedObjectType</code> is not {@link #publicKeyCert} or
         * {@link #publicKey} <code>otherObjectTypeID</code> must be given,
         * otherwise it is ignored.</p>
         *
         * @param digestedObjectType The digest object type.
         * @param otherObjectTypeID The object type ID for
         *            <code>otherObjectDigest</code>.
         * @param digestAlgorithm The algorithm identifier for the hash.
         * @param objectDigest The hash value.
         */
        public ObjectDigestInfo(
            int					digestedObjectType,
            string				otherObjectTypeID,
            AlgorithmIdentifier	digestAlgorithm,
            byte[]				objectDigest)
        {
            this.digestedObjectType = new DerEnumerated(digestedObjectType);

            if (digestedObjectType == OtherObjectDigest)
            {
                this.otherObjectTypeID = new DerObjectIdentifier(otherObjectTypeID);
            }

            this.digestAlgorithm = digestAlgorithm;

            this.objectDigest = new DerBitString(objectDigest);
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:30,代码来源:ObjectDigestInfo.cs


示例16: CertTemplate

        private CertTemplate(Asn1Sequence seq)
        {
            this.seq = seq;

            foreach (Asn1TaggedObject tObj in seq)
            {
                switch (tObj.TagNo)
                {
                case 0:
                    version = DerInteger.GetInstance(tObj, false);
                    break;
                case 1:
                    serialNumber = DerInteger.GetInstance(tObj, false);
                    break;
                case 2:
                    signingAlg = AlgorithmIdentifier.GetInstance(tObj, false);
                    break;
                case 3:
                    issuer = X509Name.GetInstance(tObj, true); // CHOICE
                    break;
                case 4:
                    validity = OptionalValidity.GetInstance(Asn1Sequence.GetInstance(tObj, false));
                    break;
                case 5:
                    subject = X509Name.GetInstance(tObj, true); // CHOICE
                    break;
                case 6:
                    publicKey = SubjectPublicKeyInfo.GetInstance(tObj, false);
                    break;
                case 7:
                    issuerUID = DerBitString.GetInstance(tObj, false);
                    break;
                case 8:
                    subjectUID = DerBitString.GetInstance(tObj, false);
                    break;
                case 9:
                    extensions = X509Extensions.GetInstance(tObj, false);
                    break;
                default:
                    throw new ArgumentException("unknown tag: " + tObj.TagNo, "seq");
                }
            }
        }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:43,代码来源:CertTemplate.cs


示例17: OobCertHash

		private OobCertHash(Asn1Sequence seq)
		{
			int index = seq.Count - 1;

			hashVal = DerBitString.GetInstance(seq[index--]);

			for (int i = index; i >= 0; i--)
			{
				Asn1TaggedObject tObj = (Asn1TaggedObject)seq[i];

				if (tObj.TagNo == 0)
				{
					hashAlg = AlgorithmIdentifier.GetInstance(tObj, true);
				}
				else
				{
					certId = CertId.GetInstance(tObj, true);
				}
			}
		}
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:20,代码来源:OobCertHash.cs


示例18: TbsCertificateStructure

        internal TbsCertificateStructure(
			Asn1Sequence seq)
        {
            int seqStart = 0;

            this.seq = seq;

            //
            // some certficates don't include a version number - we assume v1
            //
            if (seq[0] is DerTaggedObject)
            {
                version = DerInteger.GetInstance((Asn1TaggedObject)seq[0], true);
            }
            else
            {
                seqStart = -1;          // field 0 is missing!
                version = new DerInteger(0);
            }

            serialNumber = DerInteger.GetInstance(seq[seqStart + 1]);

            signature = AlgorithmIdentifier.GetInstance(seq[seqStart + 2]);
            issuer = X509Name.GetInstance(seq[seqStart + 3]);

            //
            // before and after dates
            //
            Asn1Sequence  dates = (Asn1Sequence)seq[seqStart + 4];

            startDate = Time.GetInstance(dates[0]);
            endDate = Time.GetInstance(dates[1]);

            subject = X509Name.GetInstance(seq[seqStart + 5]);

            //
            // public key info.
            //
            subjectPublicKeyInfo = SubjectPublicKeyInfo.GetInstance(seq[seqStart + 6]);

            for (int extras = seq.Count - (seqStart + 6) - 1; extras > 0; extras--)
            {
                DerTaggedObject extra = (DerTaggedObject) seq[seqStart + 6 + extras];

                switch (extra.TagNo)
                {
                    case 1:
                        issuerUniqueID = DerBitString.GetInstance(extra, false);
                        break;
                    case 2:
                        subjectUniqueID = DerBitString.GetInstance(extra, false);
                        break;
                    case 3:
                        extensions = X509Extensions.GetInstance(extra);
                        break;
                }
            }
        }
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:58,代码来源:TBSCertificateStructure.cs


示例19: SetIssuerUniqueID

		public void SetIssuerUniqueID(
            DerBitString issuerUniqueID)
        {
            this.issuerUniqueID = issuerUniqueID;
        }
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:5,代码来源:V2AttributeCertificateInfoGenerator.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DerInteger类代码示例发布时间:2022-05-24
下一篇:
C# Deque类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap