本文整理汇总了C#中Asn1Sequence类的典型用法代码示例。如果您正苦于以下问题:C# Asn1Sequence类的具体用法?C# Asn1Sequence怎么用?C# Asn1Sequence使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Asn1Sequence类属于命名空间,在下文中一共展示了Asn1Sequence类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: 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
示例2: 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
示例3: 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
示例4: OriginatorInfo
public OriginatorInfo(
Asn1Sequence seq)
{
switch (seq.Count)
{
case 0: // empty
break;
case 1:
Asn1TaggedObject o = (Asn1TaggedObject) seq[0];
switch (o.TagNo)
{
case 0 :
certs = Asn1Set.GetInstance(o, false);
break;
case 1 :
crls = Asn1Set.GetInstance(o, false);
break;
default:
throw new ArgumentException("Bad tag in OriginatorInfo: " + o.TagNo);
}
break;
case 2:
certs = Asn1Set.GetInstance((Asn1TaggedObject) seq[0], false);
crls = Asn1Set.GetInstance((Asn1TaggedObject) seq[1], false);
break;
default:
throw new ArgumentException("OriginatorInfo too big");
}
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:29,代码来源:OriginatorInfo.cs
示例5: V2Form
private V2Form(
Asn1Sequence seq)
{
if (seq.Count > 3)
{
throw new ArgumentException("Bad sequence size: " + seq.Count);
}
int index = 0;
if (!(seq[0] is Asn1TaggedObject))
{
index++;
this.issuerName = GeneralNames.GetInstance(seq[0]);
}
for (int i = index; i != seq.Count; i++)
{
Asn1TaggedObject o = Asn1TaggedObject.GetInstance(seq[i]);
if (o.TagNo == 0)
{
baseCertificateID = IssuerSerial.GetInstance(o, false);
}
else if (o.TagNo == 1)
{
objectDigestInfo = ObjectDigestInfo.GetInstance(o, false);
}
else
{
throw new ArgumentException("Bad tag number: " + o.TagNo);
}
}
}
开发者ID:kungfubozo,项目名称:Bouncy-Castle-WP8,代码行数:33,代码来源:V2Form.cs
示例6: RsaesOaepParameters
public RsaesOaepParameters(
Asn1Sequence seq)
{
hashAlgorithm = DefaultHashAlgorithm;
maskGenAlgorithm = DefaultMaskGenFunction;
pSourceAlgorithm = DefaultPSourceAlgorithm;
for (int i = 0; i != seq.Count; i++)
{
Asn1TaggedObject o = (Asn1TaggedObject)seq[i];
switch (o.TagNo)
{
case 0:
hashAlgorithm = AlgorithmIdentifier.GetInstance(o, true);
break;
case 1:
maskGenAlgorithm = AlgorithmIdentifier.GetInstance(o, true);
break;
case 2:
pSourceAlgorithm = AlgorithmIdentifier.GetInstance(o, true);
break;
default:
throw new ArgumentException("unknown tag");
}
}
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:27,代码来源:RSAESOAEPparams.cs
示例7: NoticeReference
/**
* Creates a new <code>NoticeReference</code> instance.
*
* @param orgName a <code>string</code> value
* @param numbers an <code>Asn1Sequence</code> value
*/
public NoticeReference(
string orgName,
Asn1Sequence numbers)
{
organization = new DisplayText(orgName);
noticeNumbers = numbers;
}
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:13,代码来源:NoticeReference.cs
示例8: SingleResponse
public SingleResponse(
Asn1Sequence seq)
{
this.certID = CertID.GetInstance(seq[0]);
this.certStatus = CertStatus.GetInstance(seq[1]);
this.thisUpdate = (DerGeneralizedTime)seq[2];
if (seq.Count > 4)
{
this.nextUpdate = DerGeneralizedTime.GetInstance(
(Asn1TaggedObject) seq[3], true);
this.singleExtensions = X509Extensions.GetInstance(
(Asn1TaggedObject) seq[4], true);
}
else if (seq.Count > 3)
{
Asn1TaggedObject o = (Asn1TaggedObject) seq[3];
if (o.TagNo == 0)
{
this.nextUpdate = DerGeneralizedTime.GetInstance(o, true);
}
else
{
this.singleExtensions = X509Extensions.GetInstance(o, true);
}
}
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:28,代码来源:SingleResponse.cs
示例9: PrivateKeyInfo
private PrivateKeyInfo(
Asn1Sequence seq)
{
IEnumerator e = seq.GetEnumerator();
e.MoveNext();
IBigInteger version = ((DerInteger) e.Current).Value;
if (version.IntValue != 0)
{
throw new ArgumentException("wrong version for private key info");
}
e.MoveNext();
algID = AlgorithmIdentifier.GetInstance(e.Current);
try
{
e.MoveNext();
Asn1OctetString data = (Asn1OctetString) e.Current;
privKey = Asn1Object.FromByteArray(data.GetOctets());
}
catch (IOException)
{
throw new ArgumentException("Error recoverying private key from sequence");
}
if (e.MoveNext())
{
attributes = Asn1Set.GetInstance((Asn1TaggedObject) e.Current, false);
}
}
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:32,代码来源:PrivateKeyInfo.cs
示例10: checkConstruction
private void checkConstruction(
NameOrPseudonym id,
string pseudonym,
DirectoryString surname,
Asn1Sequence givenName)
{
checkValues(id, pseudonym, surname, givenName);
id = NameOrPseudonym.GetInstance(id);
checkValues(id, pseudonym, surname, givenName);
Asn1InputStream aIn = new Asn1InputStream(id.ToAsn1Object().GetEncoded());
if (surname != null)
{
Asn1Sequence seq = (Asn1Sequence) aIn.ReadObject();
id = NameOrPseudonym.GetInstance(seq);
}
else
{
IAsn1String s = (IAsn1String) aIn.ReadObject();
id = NameOrPseudonym.GetInstance(s);
}
checkValues(id, pseudonym, surname, givenName);
}
开发者ID:randombit,项目名称:hacrypto,代码行数:29,代码来源:NameOrPseudonymUnitTest.cs
示例11: 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
示例12: CompressedData
public CompressedData(
Asn1Sequence seq)
{
this.version = (DerInteger) seq[0];
this.compressionAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]);
this.encapContentInfo = ContentInfo.GetInstance(seq[2]);
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:7,代码来源:CompressedData.cs
示例13: X9ECParameters
public X9ECParameters(
Asn1Sequence seq)
{
if (!(seq[0] is DerInteger)
|| !((DerInteger) seq[0]).Value.Equals(BigInteger.One))
{
throw new ArgumentException("bad version in X9ECParameters");
}
X9Curve x9c = new X9Curve(
X9FieldID.GetInstance(seq[1]),
Asn1Sequence.GetInstance(seq[2]));
this.curve = x9c.Curve;
object p = seq[3];
if (p is X9ECPoint)
{
this.g = ((X9ECPoint)p);
}
else
{
this.g = new X9ECPoint(curve, (Asn1OctetString)p);
}
this.n = ((DerInteger)seq[4]).Value;
this.seed = x9c.GetSeed();
if (seq.Count == 6)
{
this.h = ((DerInteger)seq[5]).Value;
}
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:33,代码来源:X9ECParameters.cs
示例14: 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
示例15: 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
示例16: CertifiedKeyPair
private CertifiedKeyPair(Asn1Sequence seq)
{
certOrEncCert = CertOrEncCert.GetInstance(seq[0]);
if (seq.Count >= 2)
{
if (seq.Count == 2)
{
Asn1TaggedObject tagged = Asn1TaggedObject.GetInstance(seq[1]);
if (tagged.TagNo == 0)
{
privateKey = EncryptedValue.GetInstance(tagged.GetObject());
}
else
{
publicationInfo = PkiPublicationInfo.GetInstance(tagged.GetObject());
}
}
else
{
privateKey = EncryptedValue.GetInstance(Asn1TaggedObject.GetInstance(seq[1]));
publicationInfo = PkiPublicationInfo.GetInstance(Asn1TaggedObject.GetInstance(seq[2]));
}
}
}
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:25,代码来源:CertifiedKeyPair.cs
示例17: GeneralSubtree
private GeneralSubtree(
Asn1Sequence seq)
{
baseName = GeneralName.GetInstance(seq[0]);
switch (seq.Count)
{
case 1:
break;
case 2:
{
Asn1TaggedObject o = Asn1TaggedObject.GetInstance(seq[1]);
switch (o.TagNo)
{
case 0:
minimum = DerInteger.GetInstance(o, false);
break;
case 1:
maximum = DerInteger.GetInstance(o, false);
break;
default:
throw new ArgumentException("Bad tag number: " + o.TagNo);
}
break;
}
case 3:
{
minimum = DerInteger.GetInstance(Asn1TaggedObject.GetInstance(seq[1]));
maximum = DerInteger.GetInstance(Asn1TaggedObject.GetInstance(seq[2]));
break;
}
default:
throw new ArgumentException("Bad sequence size: " + seq.Count);
}
}
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:35,代码来源:GeneralSubtree.cs
示例18: CrlOcspRef
private CrlOcspRef(
Asn1Sequence seq)
{
if (seq == null)
throw new ArgumentNullException("seq");
foreach (Asn1TaggedObject taggedObj in seq)
{
Asn1Object asn1Obj = taggedObj.GetObject();
switch (taggedObj.TagNo)
{
case 0:
this.crlids = CrlListID.GetInstance(asn1Obj);
break;
case 1:
this.ocspids = OcspListID.GetInstance(asn1Obj);
break;
case 2:
this.otherRev = OtherRevRefs.GetInstance(asn1Obj);
break;
default:
throw new ArgumentException("Illegal tag in CrlOcspRef", "seq");
}
}
}
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:26,代码来源:CrlOcspRef.cs
示例19: 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
示例20: SemanticsInformation
public SemanticsInformation(
Asn1Sequence seq)
{
if (seq.Count < 1)
{
throw new ArgumentException("no objects in SemanticsInformation");
}
IEnumerator e = seq.GetEnumerator();
e.MoveNext();
object obj = e.Current;
if (obj is DerObjectIdentifier)
{
semanticsIdentifier = DerObjectIdentifier.GetInstance(obj);
if (e.MoveNext())
{
obj = e.Current;
}
else
{
obj = null;
}
}
if (obj != null)
{
Asn1Sequence generalNameSeq = Asn1Sequence.GetInstance(obj );
nameRegistrationAuthorities = new GeneralName[generalNameSeq.Count];
for (int i= 0; i < generalNameSeq.Count; i++)
{
nameRegistrationAuthorities[i] = GeneralName.GetInstance(generalNameSeq[i]);
}
}
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:34,代码来源:SemanticsInformation.cs
注:本文中的Asn1Sequence类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论