本文整理汇总了C#中Org.BouncyCastle.Asn1.Asn1Sequence.GetEnumerator方法的典型用法代码示例。如果您正苦于以下问题:C# Asn1Sequence.GetEnumerator方法的具体用法?C# Asn1Sequence.GetEnumerator怎么用?C# Asn1Sequence.GetEnumerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Org.BouncyCastle.Asn1.Asn1Sequence
的用法示例。
在下文中一共展示了Asn1Sequence.GetEnumerator方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LdsSecurityObject
private LdsSecurityObject(
Asn1Sequence seq)
{
if (seq == null || seq.Count == 0)
throw new ArgumentException("null or empty sequence passed.");
IEnumerator e = seq.GetEnumerator();
// version
e.MoveNext();
version = DerInteger.GetInstance(e.Current);
// digestAlgorithmIdentifier
e.MoveNext();
digestAlgorithmIdentifier = AlgorithmIdentifier.GetInstance(e.Current);
e.MoveNext();
Asn1Sequence datagroupHashSeq = Asn1Sequence.GetInstance(e.Current);
if (version.Value.Equals(BigInteger.One))
{
e.MoveNext();
versionInfo = LdsVersionInfo.GetInstance(e.Current);
}
CheckDatagroupHashSeqSize(datagroupHashSeq.Count);
datagroupHash = new DataGroupHash[datagroupHashSeq.Count];
for (int i= 0; i< datagroupHashSeq.Count; i++)
{
datagroupHash[i] = DataGroupHash.GetInstance(datagroupHashSeq[i]);
}
}
示例2: 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]);
}
}
}
示例3: DHParameter
public DHParameter(
Asn1Sequence seq)
{
IEnumerator e = seq.GetEnumerator();
e.MoveNext();
p = (DerInteger)e.Current;
e.MoveNext();
g = (DerInteger)e.Current;
if (e.MoveNext())
{
l = (DerInteger) e.Current;
}
}
示例4: Pbkdf2Params
public Pbkdf2Params(
Asn1Sequence seq)
{
IEnumerator e = seq.GetEnumerator();
e.MoveNext();
octStr = (Asn1OctetString) e.Current;
e.MoveNext();
iterationCount = (DerInteger) e.Current;
if (e.MoveNext())
{
keyLength = (DerInteger) e.Current;
}
}
示例5: SignedData
private SignedData(
Asn1Sequence seq)
{
IEnumerator e = seq.GetEnumerator();
e.MoveNext();
version = (DerInteger)e.Current;
e.MoveNext();
digestAlgorithms = ((Asn1Set)e.Current);
e.MoveNext();
contentInfo = ContentInfo.GetInstance(e.Current);
while (e.MoveNext())
{
Asn1Object o = (Asn1Object)e.Current;
//
// an interesting feature of SignedData is that there appear
// to be varying implementations...
// for the moment we ignore anything which doesn't fit.
//
if (o is Asn1TaggedObject)
{
Asn1TaggedObject tagged = (Asn1TaggedObject)o;
switch (tagged.TagNo)
{
case 0:
certBer = tagged is BerTaggedObject;
certificates = Asn1Set.GetInstance(tagged, false);
break;
case 1:
crlsBer = tagged is BerTaggedObject;
crls = Asn1Set.GetInstance(tagged, false);
break;
default:
throw new ArgumentException("unknown tag value " + tagged.TagNo);
}
}
else
{
signerInfos = (Asn1Set) o;
}
}
}
示例6: SignerInfo
public SignerInfo(
Asn1Sequence seq)
{
IEnumerator e = seq.GetEnumerator();
e.MoveNext();
version = (DerInteger) e.Current;
e.MoveNext();
sid = SignerIdentifier.GetInstance(e.Current);
e.MoveNext();
digAlgorithm = AlgorithmIdentifier.GetInstance(e.Current);
e.MoveNext();
object obj = e.Current;
if (obj is Asn1TaggedObject)
{
authenticatedAttributes = Asn1Set.GetInstance((Asn1TaggedObject) obj, false);
e.MoveNext();
digEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(e.Current);
}
else
{
authenticatedAttributes = null;
digEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(obj);
}
e.MoveNext();
encryptedDigest = DerOctetString.GetInstance(e.Current);
if (e.MoveNext())
{
unauthenticatedAttributes = Asn1Set.GetInstance((Asn1TaggedObject) e.Current, false);
}
else
{
unauthenticatedAttributes = null;
}
}
示例7: X509Name
/**
* Constructs an X509 name
* @param seq an Asn1 Sequence
*/
public X509Name(Asn1Sequence seq) {
IEnumerator e = seq.GetEnumerator();
while (e.MoveNext()) {
Asn1Set sett = (Asn1Set)e.Current;
for (int i = 0; i < sett.Count; i++) {
Asn1Sequence s = (Asn1Sequence)sett[i];
String id = (String)DefaultSymbols[s[0]];
if (id == null)
continue;
ArrayList vs = (ArrayList)values[id];
if (vs == null) {
vs = new ArrayList();
values[id] = vs;
}
vs.Add(((DerStringBase)s[1]).GetString());
}
}
}
示例8: IntersectPermittedSubtree
/**
* Updates the permitted ISet of these name constraints with the intersection
* with the given subtree.
*
* @param permitted The permitted subtrees
*/
public void IntersectPermittedSubtree(Asn1Sequence permitted)
{
IDictionary subtreesMap = Platform.CreateHashtable();
// group in ISets in a map ordered by tag no.
for (IEnumerator e = permitted.GetEnumerator(); e.MoveNext(); )
{
GeneralSubtree subtree = GeneralSubtree.GetInstance(e.Current);
int tagNo = subtree.Base.TagNo;
if (subtreesMap[tagNo] == null)
{
subtreesMap[tagNo] = new HashSet();
}
((ISet)subtreesMap[tagNo]).Add(subtree);
}
for (IEnumerator it = subtreesMap.GetEnumerator(); it.MoveNext(); )
{
DictionaryEntry entry = (DictionaryEntry)it.Current;
// go through all subtree groups
switch ((int)entry.Key )
{
case 1:
permittedSubtreesEmail = IntersectEmail(permittedSubtreesEmail,
(ISet)entry.Value);
break;
case 2:
permittedSubtreesDNS = intersectDNS(permittedSubtreesDNS,
(ISet)entry.Value);
break;
case 4:
permittedSubtreesDN = IntersectDN(permittedSubtreesDN,
(ISet)entry.Value);
break;
case 6:
permittedSubtreesURI = intersectURI(permittedSubtreesURI,
(ISet)entry.Value);
break;
case 7:
permittedSubtreesIP = IntersectIP(permittedSubtreesIP,
(ISet)entry.Value);
break;
}
}
}