private SubjectPublicKeyInfo( Asn1Sequence seq) { if (seq.Count != 2) { throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); } this.algID = AlgorithmIdentifier.GetInstance(seq[0]); this.keyData = DerBitString.GetInstance(seq[1]); }
private DigestInfo( Asn1Sequence seq) { if (seq.Count != 2) { throw new ArgumentException("Wrong number of elements in sequence", "seq"); } algID = AlgorithmIdentifier.GetInstance(seq[0]); digest = Asn1OctetString.GetInstance(seq[1]).GetOctets(); }
private CertificateList( Asn1Sequence seq) { if (seq.Count != 3) { throw new ArgumentException("sequence wrong size for CertificateList", "seq"); } tbsCertList = TbsCertificateList.GetInstance(seq[0]); sigAlgID = AlgorithmIdentifier.GetInstance(seq[1]); sig = DerBitString.GetInstance(seq[2]); }
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]); }
internal TbsCertificateList( Asn1Sequence seq) { if (seq.Count < 3 || seq.Count > 7) { throw new ArgumentException("Bad sequence size: " + seq.Count); } int seqPos = 0; this.seq = seq; if (seq[seqPos] is DerInteger) { version = DerInteger.GetInstance(seq[seqPos++]); } else { version = new DerInteger(0); } signature = AlgorithmIdentifier.GetInstance(seq[seqPos++]); issuer = X509Name.GetInstance(seq[seqPos++]); thisUpdate = Time.GetInstance(seq[seqPos++]); if (seqPos < seq.Count && (seq[seqPos] is DerUtcTime || seq[seqPos] is DerGeneralizedTime || seq[seqPos] is Time)) { nextUpdate = Time.GetInstance(seq[seqPos++]); } if (seqPos < seq.Count && !(seq[seqPos] is DerTaggedObject)) { revokedCertificates = Asn1Sequence.GetInstance(seq[seqPos++]); } if (seqPos < seq.Count && seq[seqPos] is DerTaggedObject) { crlExtensions = X509Extensions.GetInstance(seq[seqPos]); } }
private ObjectDigestInfo( Asn1Sequence seq) { if (seq.Count > 4 || seq.Count < 3) { throw new ArgumentException("Bad sequence size: " + seq.Count); } digestedObjectType = DerEnumerated.GetInstance(seq[0]); int offset = 0; if (seq.Count == 4) { otherObjectTypeID = DerObjectIdentifier.GetInstance(seq[1]); offset++; } digestAlgorithm = AlgorithmIdentifier.GetInstance(seq[1 + offset]); objectDigest = DerBitString.GetInstance(seq[2 + offset]); }