public virtual void SetProhibitedACAttributes(ISet prohibitedACAttributes) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (prohibitedACAttributes == null) { this.prohibitedACAttributes = new HashSet(); return; } global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)prohibitedACAttributes).GetEnumerator(); try { while (enumerator.MoveNext()) { object current = enumerator.get_Current(); if (!(current is string)) { throw new InvalidCastException("All elements of set must be of type string."); } } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } this.prohibitedACAttributes = new HashSet(prohibitedACAttributes); }
private void AddCertsFromSet(global::System.Collections.IList certs, Asn1Set certSet) { X509CertificateParser x509CertificateParser = new X509CertificateParser(); global::System.Collections.IEnumerator enumerator = certSet.GetEnumerator(); try { while (enumerator.MoveNext()) { Asn1Encodable asn1Encodable = (Asn1Encodable)enumerator.get_Current(); try { Asn1Object asn1Object = asn1Encodable.ToAsn1Object(); if (asn1Object is Asn1Sequence) { certs.Add((object)x509CertificateParser.ReadCertificate(asn1Object.GetEncoded())); } } catch (global::System.Exception e) { throw new CmsException("can't re-encode certificate!", e); } } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
private OptionalValidity(Asn1Sequence seq) { global::System.Collections.IEnumerator enumerator = seq.GetEnumerator(); try { while (enumerator.MoveNext()) { Asn1TaggedObject asn1TaggedObject = (Asn1TaggedObject)enumerator.get_Current(); if (asn1TaggedObject.TagNo == 0) { notBefore = Time.GetInstance(asn1TaggedObject, explicitly: true); } else { notAfter = Time.GetInstance(asn1TaggedObject, explicitly: true); } } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
internal DerSet(Asn1EncodableVector v, bool needsSorting) : base(v.Count) { global::System.Collections.IEnumerator enumerator = v.GetEnumerator(); try { while (enumerator.MoveNext()) { Asn1Encodable obj = (Asn1Encodable)enumerator.get_Current(); AddObject(obj); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } if (needsSorting) { Sort(); } }
public PgpSecretKeyRing GetSecretKeyRing(long keyId) { if (secretRings.Contains((object)keyId)) { return((PgpSecretKeyRing)secretRings.get_Item((object)keyId)); } global::System.Collections.IEnumerator enumerator = GetKeyRings().GetEnumerator(); try { while (enumerator.MoveNext()) { PgpSecretKeyRing pgpSecretKeyRing = (PgpSecretKeyRing)enumerator.get_Current(); PgpSecretKey secretKey = pgpSecretKeyRing.GetSecretKey(keyId); if (secretKey != null) { return(pgpSecretKeyRing); } } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } return(null); }
internal override void Encode(DerOutputStream derOut) { if (derOut is Asn1OutputStream || derOut is BerOutputStream) { ((Stream)derOut).WriteByte((byte)48); ((Stream)derOut).WriteByte((byte)128); { global::System.Collections.IEnumerator enumerator = GetEnumerator(); try { while (enumerator.MoveNext()) { Asn1Encodable obj = (Asn1Encodable)enumerator.get_Current(); derOut.WriteObject(obj); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } } ((Stream)derOut).WriteByte((byte)0); ((Stream)derOut).WriteByte((byte)0); } else { base.Encode(derOut); } }
public virtual void Encode(Stream output) { global::System.Collections.IList list = Platform.CreateArrayList(mCertificateList.Length); int num = 0; X509CertificateStructure[] array = mCertificateList; foreach (Asn1Encodable asn1Encodable in array) { byte[] encoded = asn1Encodable.GetEncoded("DER"); list.Add((object)encoded); num += encoded.Length + 3; } TlsUtilities.CheckUint24(num); TlsUtilities.WriteUint24(num, output); global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)list).GetEnumerator(); try { while (enumerator.MoveNext()) { byte[] buf = (byte[])enumerator.get_Current(); TlsUtilities.WriteOpaque24(buf, output); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
public virtual void BlockUpdate(byte[] input, int inOff, int len) { if (mBuf != null) { ((Stream)mBuf).Write(input, inOff, len); return; } global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)mHashes.get_Values()).GetEnumerator(); try { while (enumerator.MoveNext()) { IDigest digest = (IDigest)enumerator.get_Current(); digest.BlockUpdate(input, inOff, len); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
public virtual void Reset() { if (mBuf != null) { ((Stream)mBuf).SetLength(0L); return; } global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)mHashes.get_Values()).GetEnumerator(); try { while (enumerator.MoveNext()) { IDigest digest = (IDigest)enumerator.get_Current(); digest.Reset(); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
private static byte[] ToBytes(global::System.Collections.IEnumerable octs) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown MemoryStream val = new MemoryStream(); global::System.Collections.IEnumerator enumerator = octs.GetEnumerator(); try { while (enumerator.MoveNext()) { DerOctetString derOctetString = (DerOctetString)enumerator.get_Current(); byte[] octets = derOctetString.GetOctets(); ((Stream)val).Write(octets, 0, octets.Length); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } return(val.ToArray()); }
public NameConstraints(Asn1Sequence seq) { global::System.Collections.IEnumerator enumerator = seq.GetEnumerator(); try { while (enumerator.MoveNext()) { Asn1TaggedObject asn1TaggedObject = (Asn1TaggedObject)enumerator.get_Current(); switch (asn1TaggedObject.TagNo) { case 0: permitted = Asn1Sequence.GetInstance(asn1TaggedObject, explicitly: false); break; case 1: excluded = Asn1Sequence.GetInstance(asn1TaggedObject, explicitly: false); break; } } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
public X509Name(global::System.Collections.IList ordering, IDictionary attributes, X509NameEntryConverter converter) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) this.converter = converter; global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)ordering).GetEnumerator(); try { while (enumerator.MoveNext()) { DerObjectIdentifier derObjectIdentifier = (DerObjectIdentifier)enumerator.get_Current(); object obj = attributes.get_Item((object)derObjectIdentifier); if (obj == null) { throw new ArgumentException(string.Concat((object)"No attribute for object id - ", (object)derObjectIdentifier, (object)" - passed to distinguished name")); } this.ordering.Add((object)derObjectIdentifier); added.Add((object)false); values.Add(obj); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
private Asn1Object GetObjectInTag(int tagNo) { global::System.Collections.IEnumerator enumerator = seq.GetEnumerator(); try { while (enumerator.MoveNext()) { Asn1Encodable asn1Encodable = (Asn1Encodable)enumerator.get_Current(); Asn1Object asn1Object = asn1Encodable.ToAsn1Object(); if (asn1Object is Asn1TaggedObject) { Asn1TaggedObject asn1TaggedObject = (Asn1TaggedObject)asn1Object; if (asn1TaggedObject.TagNo == tagNo) { return(asn1TaggedObject.GetObject()); } } } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } return(null); }
public virtual void SetAttrCertCheckers(ISet attrCertCheckers) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (attrCertCheckers == null) { this.attrCertCheckers = new HashSet(); return; } global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)attrCertCheckers).GetEnumerator(); try { while (enumerator.MoveNext()) { object current = enumerator.get_Current(); if (!(current is PkixAttrCertChecker)) { throw new InvalidCastException("All elements of set must be of type " + typeof(PkixAttrCertChecker).get_FullName() + "."); } } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } this.attrCertCheckers = new HashSet(attrCertCheckers); }
public CmsTypedStream GetSignedContent() { if (_signedContent == null) { return(null); } Stream val = _signedContent.ContentStream; global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)_digests.get_Values()).GetEnumerator(); try { while (enumerator.MoveNext()) { IDigest readDigest = (IDigest)enumerator.get_Current(); val = (Stream)(object)new DigestStream(val, readDigest, null); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } return(new CmsTypedStream(_signedContent.ContentType, val)); }
protected virtual void CheckStopBuffering() { if (mBuf == null || ((global::System.Collections.ICollection)mHashes).get_Count() > 4) { return; } global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)mHashes.get_Values()).GetEnumerator(); try { while (enumerator.MoveNext()) { IDigest d = (IDigest)enumerator.get_Current(); mBuf.UpdateDigest(d); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } mBuf = null; }
private ISet ExtractGeneralNames(global::System.Collections.IEnumerable names) { ISet set = new HashSet(); if (names != null) { global::System.Collections.IEnumerator enumerator = names.GetEnumerator(); try { while (enumerator.MoveNext()) { object current = enumerator.get_Current(); if (current is GeneralName) { set.Add(current); } else { set.Add(GeneralName.GetInstance(Asn1Object.FromByteArray((byte[])current))); } } return(set); } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } } return(set); }
private ExtendedKeyUsage(Asn1Sequence seq) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) this.seq = seq; global::System.Collections.IEnumerator enumerator = seq.GetEnumerator(); try { while (enumerator.MoveNext()) { object current = enumerator.get_Current(); if (!(current is DerObjectIdentifier)) { throw new ArgumentException("Only DerObjectIdentifier instances allowed in ExtendedKeyUsage."); } usageTable.set_Item(current, current); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
private OcspListID(Asn1Sequence seq) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (seq == null) { throw new ArgumentNullException("seq"); } if (seq.Count != 1) { throw new ArgumentException(string.Concat((object)"Bad sequence size: ", (object)seq.Count), "seq"); } ocspResponses = (Asn1Sequence)seq[0].ToAsn1Object(); global::System.Collections.IEnumerator enumerator = ocspResponses.GetEnumerator(); try { while (enumerator.MoveNext()) { Asn1Encodable asn1Encodable = (Asn1Encodable)enumerator.get_Current(); OcspResponsesID.GetInstance(asn1Encodable.ToAsn1Object()); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
public ExtendedKeyUsage(global::System.Collections.IEnumerable usages) { Asn1EncodableVector asn1EncodableVector = new Asn1EncodableVector(); global::System.Collections.IEnumerator enumerator = usages.GetEnumerator(); try { while (enumerator.MoveNext()) { object current = enumerator.get_Current(); Asn1Encodable instance = DerObjectIdentifier.GetInstance(current); asn1EncodableVector.Add(instance); usageTable.set_Item((object)instance, (object)instance); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } seq = new DerSequence(asn1EncodableVector); }
public PkiFreeText(Asn1Sequence seq) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) global::System.Collections.IEnumerator enumerator = seq.GetEnumerator(); try { while (enumerator.MoveNext()) { object current = enumerator.get_Current(); if (!(current is DerUtf8String)) { throw new ArgumentException("attempt to insert non UTF8 STRING into PkiFreeText"); } } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } strings = seq; }
public bool IsExcluded(string name) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown bool result = false; global::System.Collections.IEnumerator enumerator = exclusions_.GetEnumerator(); try { while (enumerator.MoveNext()) { Regex val = (Regex)enumerator.get_Current(); if (val.IsMatch(name)) { return(true); } } return(result); } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
public SignerInformationStore(global::System.Collections.ICollection signerInfos) { global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)signerInfos).GetEnumerator(); try { while (enumerator.MoveNext()) { SignerInformation signerInformation = (SignerInformation)enumerator.get_Current(); SignerID signerID = signerInformation.SignerID; global::System.Collections.IList list = (global::System.Collections.IList)table.get_Item((object)signerID); if (list == null) { table.set_Item((object)signerID, (object)(list = Platform.CreateArrayList(1))); } list.Add((object)signerInformation); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } all = Platform.CreateArrayList(signerInfos); }
public void AddAttributeCertificates(IX509Store store) { try { global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)store.GetMatches(null)).GetEnumerator(); try { while (enumerator.MoveNext()) { IX509AttributeCertificate iX509AttributeCertificate = (IX509AttributeCertificate)enumerator.get_Current(); _certs.Add((object)new DerTaggedObject(explicitly: false, 2, AttributeCertificate.GetInstance(Asn1Object.FromByteArray(iX509AttributeCertificate.GetEncoded())))); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } } catch (global::System.Exception e) { throw new CmsException("error processing attribute certs", e); } }
public PgpSecretKeyRingBundle(global::System.Collections.IEnumerable e) { secretRings = Platform.CreateHashtable(); order = Platform.CreateArrayList(); global::System.Collections.IEnumerator enumerator = e.GetEnumerator(); try { while (enumerator.MoveNext()) { object current = enumerator.get_Current(); PgpSecretKeyRing pgpSecretKeyRing = current as PgpSecretKeyRing; if (pgpSecretKeyRing == null) { throw new PgpException(Platform.GetTypeName(current) + " found where PgpSecretKeyRing expected"); } long keyId = pgpSecretKeyRing.GetPublicKey().KeyId; secretRings.Add((object)keyId, (object)pgpSecretKeyRing); order.Add((object)keyId); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
private ISet LoadCrlEntries() { ISet set = new HashSet(); global::System.Collections.IEnumerable revokedCertificateEnumeration = c.GetRevokedCertificateEnumeration(); X509Name previousCertificateIssuer = IssuerDN; global::System.Collections.IEnumerator enumerator = revokedCertificateEnumeration.GetEnumerator(); try { while (enumerator.MoveNext()) { CrlEntry crlEntry = (CrlEntry)enumerator.get_Current(); X509CrlEntry x509CrlEntry = new X509CrlEntry(crlEntry, isIndirect, previousCertificateIssuer); set.Add(x509CrlEntry); previousCertificateIssuer = x509CrlEntry.GetCertificateIssuer(); } return(set); } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
private void AddCrlsFromSet(global::System.Collections.IList crls, Asn1Set crlSet) { X509CrlParser x509CrlParser = new X509CrlParser(); global::System.Collections.IEnumerator enumerator = crlSet.GetEnumerator(); try { while (enumerator.MoveNext()) { Asn1Encodable asn1Encodable = (Asn1Encodable)enumerator.get_Current(); try { crls.Add((object)x509CrlParser.ReadCrl(asn1Encodable.GetEncoded())); } catch (global::System.Exception e) { throw new CmsException("can't re-encode CRL!", e); } } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } }
public virtual X509CrlEntry GetRevokedCertificate(BigInteger serialNumber) { global::System.Collections.IEnumerable revokedCertificateEnumeration = c.GetRevokedCertificateEnumeration(); X509Name previousCertificateIssuer = IssuerDN; global::System.Collections.IEnumerator enumerator = revokedCertificateEnumeration.GetEnumerator(); try { while (enumerator.MoveNext()) { CrlEntry crlEntry = (CrlEntry)enumerator.get_Current(); X509CrlEntry x509CrlEntry = new X509CrlEntry(crlEntry, isIndirect, previousCertificateIssuer); if (serialNumber.Equals(crlEntry.UserCertificate.Value)) { return(x509CrlEntry); } previousCertificateIssuer = x509CrlEntry.GetCertificateIssuer(); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } return(null); }
internal override void Encode(DerOutputStream derOut) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown MemoryStream val = new MemoryStream(); DerOutputStream derOutputStream = new DerOutputStream((Stream)(object)val); global::System.Collections.IEnumerator enumerator = GetEnumerator(); try { while (enumerator.MoveNext()) { Asn1Encodable obj = (Asn1Encodable)enumerator.get_Current(); derOutputStream.WriteObject(obj); } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } Platform.Dispose((Stream)(object)derOutputStream); byte[] bytes = val.ToArray(); derOut.WriteEncoded(48, bytes); }
public virtual void SetStores(global::System.Collections.IList stores) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (stores == null) { this.stores = Platform.CreateArrayList(); return; } global::System.Collections.IEnumerator enumerator = ((global::System.Collections.IEnumerable)stores).GetEnumerator(); try { while (enumerator.MoveNext()) { object current = enumerator.get_Current(); if (!(current is IX509Store)) { throw new InvalidCastException("All elements of list must be of type " + typeof(IX509Store).get_FullName()); } } } finally { global::System.IDisposable disposable = enumerator as global::System.IDisposable; if (disposable != null) { disposable.Dispose(); } } this.stores = Platform.CreateArrayList((global::System.Collections.ICollection)stores); }