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


C# Asn1OctetString类代码示例

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


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

示例1: KeySpecificInfo

		public KeySpecificInfo(
            DerObjectIdentifier	algorithm,
            Asn1OctetString		counter)
        {
            this.algorithm = algorithm;
            this.counter = counter;
        }
开发者ID:woutersmit,项目名称:NBitcoin,代码行数:7,代码来源:KeySpecificInfo.cs

示例2: KekIdentifier

		public KekIdentifier(
            Asn1Sequence seq)
        {
            keyIdentifier = (Asn1OctetString) seq[0];

			switch (seq.Count)
            {
            case 1:
				break;
            case 2:
				if (seq[1] is DerGeneralizedTime)
				{
					date = (DerGeneralizedTime) seq[1];
				}
				else
				{
					other = OtherKeyAttribute.GetInstance(seq[2]);
				}
				break;
            case 3:
				date  = (DerGeneralizedTime) seq[1];
				other = OtherKeyAttribute.GetInstance(seq[2]);
				break;
            default:
				throw new ArgumentException("Invalid KekIdentifier");
            }
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:27,代码来源:KEKIdentifier.cs

示例3: 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

示例4: PbmParameter

 private PbmParameter(Asn1Sequence seq)
 {
     salt = Asn1OctetString.GetInstance(seq[0]);
     owf = AlgorithmIdentifier.GetInstance(seq[1]);
     iterationCount = DerInteger.GetInstance(seq[2]);
     mac = AlgorithmIdentifier.GetInstance(seq[3]);
 }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:7,代码来源:PbmParameter.cs

示例5: CertResponse

		private CertResponse(Asn1Sequence seq)
		{
			certReqId = DerInteger.GetInstance(seq[0]);
			status = PkiStatusInfo.GetInstance(seq[1]);

			if (seq.Count >= 3)
			{
				if (seq.Count == 3)
				{
					Asn1Encodable o = seq[2];
					if (o is Asn1OctetString)
					{
						rspInfo = Asn1OctetString.GetInstance(o);
					}
					else
					{
						certifiedKeyPair = CertifiedKeyPair.GetInstance(o);
					}
				}
				else
				{
					certifiedKeyPair = CertifiedKeyPair.GetInstance(seq[2]);
					rspInfo = Asn1OctetString.GetInstance(seq[3]);
				}
			}
		}
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:26,代码来源:CertResponse.cs

示例6: AuthenticatedData

		public AuthenticatedData(
			OriginatorInfo		originatorInfo,
			Asn1Set				recipientInfos,
			AlgorithmIdentifier	macAlgorithm,
			AlgorithmIdentifier	digestAlgorithm,
			ContentInfo			encapsulatedContent,
			Asn1Set				authAttrs,
			Asn1OctetString		mac,
			Asn1Set				unauthAttrs)
		{
			if (digestAlgorithm != null || authAttrs != null)
			{
				if (digestAlgorithm == null || authAttrs == null)
				{
					throw new ArgumentException("digestAlgorithm and authAttrs must be set together");
				}
			}

			version = new DerInteger(CalculateVersion(originatorInfo));

			this.originatorInfo = originatorInfo;
			this.macAlgorithm = macAlgorithm;
			this.digestAlgorithm = digestAlgorithm;
			this.recipientInfos = recipientInfos;
			this.encapsulatedContentInfo = encapsulatedContent;
			this.authAttrs = authAttrs;
			this.mac = mac;
			this.unauthAttrs = unauthAttrs;
		}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:29,代码来源:AuthenticatedData.cs

示例7: Pbkdf2Params

        public Pbkdf2Params(
            Asn1Sequence seq)
        {
            if (seq.Count < 2 || seq.Count > 4)
                throw new ArgumentException("Wrong number of elements in sequence", "seq");

            this.octStr = (Asn1OctetString)seq[0];
            this.iterationCount = (DerInteger)seq[1];

            Asn1Encodable kl = null, d = null;
            if (seq.Count > 3)
            {
                kl = seq[2];
                d = seq[3];
            }
            else if (seq.Count > 2)
            {
                if (seq[2] is DerInteger)
                {
                    kl = seq[2];
                }
                else
                {
                    d = seq[2];
                }
            }
            if (kl != null)
            {
                keyLength = (DerInteger)kl;
            }
            if (d != null)
            {
                prf = AlgorithmIdentifier.GetInstance(d);
            }
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:35,代码来源:PBKDF2Params.cs

示例8: RecipientEncryptedKey

 public RecipientEncryptedKey(
     KeyAgreeRecipientIdentifier	id,
     Asn1OctetString				encryptedKey)
 {
     this.identifier = id;
     this.encryptedKey = encryptedKey;
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:7,代码来源:RecipientEncryptedKey.cs

示例9: X509Extension

		public X509Extension(
            bool			critical,
            Asn1OctetString	value)
        {
            this.critical = critical;
            this.value = value;
        }
开发者ID:woutersmit,项目名称:NBitcoin,代码行数:7,代码来源:X509Extension.cs

示例10: AuthEnvelopedData

        public AuthEnvelopedData(
            OriginatorInfo			originatorInfo,
            Asn1Set					recipientInfos,
            EncryptedContentInfo	authEncryptedContentInfo,
            Asn1Set					authAttrs,
            Asn1OctetString			mac,
            Asn1Set					unauthAttrs)
        {
            // "It MUST be set to 0."
            this.version = new DerInteger(0);

            this.originatorInfo = originatorInfo;

            // TODO
            // "There MUST be at least one element in the collection."
            this.recipientInfos = recipientInfos;

            this.authEncryptedContentInfo = authEncryptedContentInfo;

            // TODO
            // "The authAttrs MUST be present if the content type carried in
            // EncryptedContentInfo is not id-data."
            this.authAttrs = authAttrs;

            this.mac = mac;

            this.unauthAttrs = unauthAttrs;
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:28,代码来源:AuthEnvelopedData.cs

示例11: OtherHash

		public OtherHash(
			Asn1OctetString sha1Hash)
		{
			if (sha1Hash == null)
				throw new ArgumentNullException("sha1Hash");

			this.sha1Hash = sha1Hash;
		}
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:8,代码来源:OtherHash.cs

示例12: KekRecipientInfo

		public KekRecipientInfo(
            Asn1Sequence seq)
        {
            version = (DerInteger) seq[0];
            kekID = KekIdentifier.GetInstance(seq[1]);
            keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]);
            encryptedKey = (Asn1OctetString) seq[3];
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:8,代码来源:KEKRecipientInfo.cs

示例13: PbeParameter

		private PbeParameter(Asn1Sequence seq)
		{
			if (seq.Count != 2)
				throw new ArgumentException("Wrong number of elements in sequence", "seq");

			salt = Asn1OctetString.GetInstance(seq[0]);
			iterationCount = DerInteger.GetInstance(seq[1]);
		}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:8,代码来源:PBEParameter.cs

示例14: KeyTransRecipientInfo

		public KeyTransRecipientInfo(
            Asn1Sequence seq)
        {
            this.version = (DerInteger) seq[0];
            this.rid = RecipientIdentifier.GetInstance(seq[1]);
            this.keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]);
            this.encryptedKey = (Asn1OctetString) seq[3];
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:8,代码来源:KeyTransRecipientInfo.cs

示例15: PasswordRecipientInfo

		public PasswordRecipientInfo(
            AlgorithmIdentifier	keyEncryptionAlgorithm,
            Asn1OctetString		encryptedKey)
        {
            this.version = new DerInteger(0);
            this.keyEncryptionAlgorithm = keyEncryptionAlgorithm;
            this.encryptedKey = encryptedKey;
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:8,代码来源:PasswordRecipientInfo.cs


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