public CertOrEncCert(CmpCertificate certificate) { if (certificate == null) throw new ArgumentNullException("certificate"); this.certificate = certificate; }
private KeyRecRepContent(Asn1Sequence seq) { status = PkiStatusInfo.GetInstance(seq[0]); for (int pos = 1; pos < seq.Count; ++pos) { Asn1TaggedObject tObj = Asn1TaggedObject.GetInstance(seq[pos]); switch (tObj.TagNo) { case 0: newSigCert = CmpCertificate.GetInstance(tObj.GetObject()); break; case 1: caCerts = Asn1Sequence.GetInstance(tObj.GetObject()); break; case 2: keyPairHist = Asn1Sequence.GetInstance(tObj.GetObject()); break; default: throw new ArgumentException("unknown tag number: " + tObj.TagNo, "seq"); } } }
public CertOrEncCert(CmpCertificate certificate) { if (certificate == null) { throw new ArgumentNullException("certificate"); } this.certificate = certificate; }
public CertRepMessage(CmpCertificate[] caPubs, CertResponse[] response) { if (response == null) throw new ArgumentNullException("response"); if (caPubs != null) { this.caPubs = new DerSequence(caPubs); } this.response = new DerSequence(response); }
public virtual CmpCertificate[] GetCACerts() { if (caCerts == null) return null; CmpCertificate[] results = new CmpCertificate[caCerts.Count]; for (int i = 0; i != results.Length; ++i) { results[i] = CmpCertificate.GetInstance(caCerts[i]); } return results; }
/** * Creates a new PkiMessage. * * @param header message header * @param body message body * @param protection message protection (may be null) * @param extraCerts extra certificates (may be null) */ public PkiMessage( PkiHeader header, PkiBody body, DerBitString protection, CmpCertificate[] extraCerts) { this.header = header; this.body = body; this.protection = protection; if (extraCerts != null) { this.extraCerts = new DerSequence(extraCerts); } }
public virtual CmpCertificate[] GetExtraCerts() { if (extraCerts == null) { return(null); } CmpCertificate[] results = new CmpCertificate[extraCerts.Count]; for (int i = 0; i < results.Length; ++i) { results[i] = CmpCertificate.GetInstance(extraCerts[i]); } return(results); }
public virtual CmpCertificate[] GetCAPubs() { if (caPubs == null) { return(null); } CmpCertificate[] results = new CmpCertificate[caPubs.Count]; for (int i = 0; i != results.Length; ++i) { results[i] = CmpCertificate.GetInstance(caPubs[i]); } return(results); }
private CertOrEncCert(Asn1TaggedObject tagged) { if (tagged.TagNo == 0) { certificate = CmpCertificate.GetInstance(tagged.GetObject()); } else if (tagged.TagNo == 1) { encryptedCert = EncryptedValue.GetInstance(tagged.GetObject()); } else { throw new ArgumentException("unknown tag: " + tagged.TagNo, "tagged"); } }
private CAKeyUpdAnnContent(Asn1Sequence seq) { oldWithNew = CmpCertificate.GetInstance(seq[0]); newWithOld = CmpCertificate.GetInstance(seq[1]); newWithNew = CmpCertificate.GetInstance(seq[2]); }
private static Asn1Encodable GetBodyForType( int type, Asn1Encodable o) { switch (type) { case TYPE_INIT_REQ: return(CertReqMessages.GetInstance(o)); case TYPE_INIT_REP: return(CertRepMessage.GetInstance(o)); case TYPE_CERT_REQ: return(CertReqMessages.GetInstance(o)); case TYPE_CERT_REP: return(CertRepMessage.GetInstance(o)); case TYPE_P10_CERT_REQ: return(CertificationRequest.GetInstance(o)); case TYPE_POPO_CHALL: return(PopoDecKeyChallContent.GetInstance(o)); case TYPE_POPO_REP: return(PopoDecKeyRespContent.GetInstance(o)); case TYPE_KEY_UPDATE_REQ: return(CertReqMessages.GetInstance(o)); case TYPE_KEY_UPDATE_REP: return(CertRepMessage.GetInstance(o)); case TYPE_KEY_RECOVERY_REQ: return(CertReqMessages.GetInstance(o)); case TYPE_KEY_RECOVERY_REP: return(KeyRecRepContent.GetInstance(o)); case TYPE_REVOCATION_REQ: return(RevReqContent.GetInstance(o)); case TYPE_REVOCATION_REP: return(RevRepContent.GetInstance(o)); case TYPE_CROSS_CERT_REQ: return(CertReqMessages.GetInstance(o)); case TYPE_CROSS_CERT_REP: return(CertRepMessage.GetInstance(o)); case TYPE_CA_KEY_UPDATE_ANN: return(CAKeyUpdAnnContent.GetInstance(o)); case TYPE_CERT_ANN: return(CmpCertificate.GetInstance(o)); case TYPE_REVOCATION_ANN: return(RevAnnContent.GetInstance(o)); case TYPE_CRL_ANN: return(CrlAnnContent.GetInstance(o)); case TYPE_CONFIRM: return(PkiConfirmContent.GetInstance(o)); case TYPE_NESTED: return(PkiMessages.GetInstance(o)); case TYPE_GEN_MSG: return(GenMsgContent.GetInstance(o)); case TYPE_GEN_REP: return(GenRepContent.GetInstance(o)); case TYPE_ERROR: return(ErrorMsgContent.GetInstance(o)); case TYPE_CERT_CONFIRM: return(CertConfirmContent.GetInstance(o)); case TYPE_POLL_REQ: return(PollReqContent.GetInstance(o)); case TYPE_POLL_REP: return(PollRepContent.GetInstance(o)); default: throw new ArgumentException("unknown tag number: " + type, "type"); } }