当前位置: 首页>>代码示例>>C#>>正文


C# DerBitString类代码示例

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


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


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