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); } } }
/** * @param status * @param statusString */ public PkiStatusInfo( int status, PkiFreeText statusString) { this.status = new DerInteger(status); this.statusString = statusString; }
public PkiStatusInfo( int status, PkiFreeText statusString, PkiFailureInfo failInfo) { this.status = new DerInteger(status); this.statusString = statusString; this.failInfo = failInfo; }
private PollRepContent(Asn1Sequence seq) { certReqId = DerInteger.GetInstance(seq[0]); checkAfter = DerInteger.GetInstance(seq[1]); if (seq.Count > 2) { reason = PkiFreeText.GetInstance(seq[2]); } }
public ErrorMsgContent(PkiStatusInfo pkiStatusInfo, DerInteger errorCode, PkiFreeText errorDetails) { if (pkiStatusInfo == null) { throw new ArgumentNullException("pkiStatusInfo"); } this.pkiStatusInfo = pkiStatusInfo; this.errorCode = errorCode; this.errorDetails = errorDetails; }
public ErrorMsgContent(PkiStatusInfo pkiStatusInfo, DerInteger errorCode, PkiFreeText errorDetails) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (pkiStatusInfo == null) { throw new ArgumentNullException("pkiStatusInfo"); } this.pkiStatusInfo = pkiStatusInfo; this.errorCode = errorCode; this.errorDetails = errorDetails; }
private PkiHeader(Asn1Sequence seq) { pvno = DerInteger.GetInstance(seq[0]); sender = GeneralName.GetInstance(seq[1]); recipient = GeneralName.GetInstance(seq[2]); for (int pos = 3; pos < seq.Count; ++pos) { Asn1TaggedObject tObj = (Asn1TaggedObject)seq[pos]; switch (tObj.TagNo) { case 0: messageTime = DerGeneralizedTime.GetInstance(tObj, true); break; case 1: protectionAlg = AlgorithmIdentifier.GetInstance(tObj, true); break; case 2: senderKID = Asn1OctetString.GetInstance(tObj, true); break; case 3: recipKID = Asn1OctetString.GetInstance(tObj, true); break; case 4: transactionID = Asn1OctetString.GetInstance(tObj, true); break; case 5: senderNonce = Asn1OctetString.GetInstance(tObj, true); break; case 6: recipNonce = Asn1OctetString.GetInstance(tObj, true); break; case 7: freeText = PkiFreeText.GetInstance(tObj, true); break; case 8: generalInfo = Asn1Sequence.GetInstance(tObj, true); break; default: throw new ArgumentException("unknown tag number: " + tObj.TagNo, "seq"); } } }
public ErrorMsgContent( PkiStatusInfo pkiStatusInfo, DerInteger errorCode, PkiFreeText errorDetails) { if (pkiStatusInfo == null) throw new ArgumentNullException("pkiStatusInfo"); this.pkiStatusInfo = pkiStatusInfo; this.errorCode = errorCode; this.errorDetails = errorDetails; }
private PkiHeader(Asn1Sequence seq) { //IL_012d: Unknown result type (might be due to invalid IL or missing references) pvno = DerInteger.GetInstance(seq[0]); sender = GeneralName.GetInstance(seq[1]); recipient = GeneralName.GetInstance(seq[2]); for (int i = 3; i < seq.Count; i++) { Asn1TaggedObject asn1TaggedObject = (Asn1TaggedObject)seq[i]; switch (asn1TaggedObject.TagNo) { case 0: messageTime = DerGeneralizedTime.GetInstance(asn1TaggedObject, isExplicit: true); break; case 1: protectionAlg = AlgorithmIdentifier.GetInstance(asn1TaggedObject, explicitly: true); break; case 2: senderKID = Asn1OctetString.GetInstance(asn1TaggedObject, isExplicit: true); break; case 3: recipKID = Asn1OctetString.GetInstance(asn1TaggedObject, isExplicit: true); break; case 4: transactionID = Asn1OctetString.GetInstance(asn1TaggedObject, isExplicit: true); break; case 5: senderNonce = Asn1OctetString.GetInstance(asn1TaggedObject, isExplicit: true); break; case 6: recipNonce = Asn1OctetString.GetInstance(asn1TaggedObject, isExplicit: true); break; case 7: freeText = PkiFreeText.GetInstance(asn1TaggedObject, isExplicit: true); break; case 8: generalInfo = Asn1Sequence.GetInstance(asn1TaggedObject, explicitly: true); break; default: throw new ArgumentException(string.Concat((object)"unknown tag number: ", (object)asn1TaggedObject.TagNo), "seq"); } } }
private PkiHeader(Asn1Sequence seq) { this.pvno = DerInteger.GetInstance(seq[0]); this.sender = GeneralName.GetInstance(seq[1]); this.recipient = GeneralName.GetInstance(seq[2]); for (int i = 3; i < seq.Count; i++) { Asn1TaggedObject asn1TaggedObject = (Asn1TaggedObject)seq[i]; switch (asn1TaggedObject.TagNo) { case 0: this.messageTime = DerGeneralizedTime.GetInstance(asn1TaggedObject, true); break; case 1: this.protectionAlg = AlgorithmIdentifier.GetInstance(asn1TaggedObject, true); break; case 2: this.senderKID = Asn1OctetString.GetInstance(asn1TaggedObject, true); break; case 3: this.recipKID = Asn1OctetString.GetInstance(asn1TaggedObject, true); break; case 4: this.transactionID = Asn1OctetString.GetInstance(asn1TaggedObject, true); break; case 5: this.senderNonce = Asn1OctetString.GetInstance(asn1TaggedObject, true); break; case 6: this.recipNonce = Asn1OctetString.GetInstance(asn1TaggedObject, true); break; case 7: this.freeText = PkiFreeText.GetInstance(asn1TaggedObject, true); break; case 8: this.generalInfo = Asn1Sequence.GetInstance(asn1TaggedObject, true); break; default: throw new ArgumentException("unknown tag number: " + asn1TaggedObject.TagNo, "seq"); } } }
private ErrorMsgContent(Asn1Sequence seq) { pkiStatusInfo = PkiStatusInfo.GetInstance(seq[0]); for (int i = 1; i < seq.Count; i++) { Asn1Encodable asn1Encodable = seq[i]; if (asn1Encodable is DerInteger) { errorCode = DerInteger.GetInstance(asn1Encodable); } else { errorDetails = PkiFreeText.GetInstance(asn1Encodable); } } }
private ErrorMsgContent(Asn1Sequence seq) { pkiStatusInfo = PkiStatusInfo.GetInstance(seq[0]); for (int pos = 1; pos < seq.Count; ++pos) { Asn1Encodable ae = seq[pos]; if (ae is DerInteger) { errorCode = DerInteger.GetInstance(ae); } else { errorDetails = PkiFreeText.GetInstance(ae); } } }
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]); return; } if (seq.Count > 1) { object obj = seq[1]; if (obj is DerBitString) { this.failInfo = DerBitString.GetInstance(obj); return; } this.statusString = PkiFreeText.GetInstance(obj); } }
public PkiStatusInfo(Asn1Sequence seq) { status = DerInteger.GetInstance(seq[0]); statusString = null; failInfo = null; if (seq.Count > 2) { statusString = PkiFreeText.GetInstance(seq[1]); failInfo = DerBitString.GetInstance(seq[2]); } else if (seq.Count > 1) { object obj = seq[1]; if (obj is DerBitString) { failInfo = DerBitString.GetInstance(obj); } else { statusString = PkiFreeText.GetInstance(obj); } } }
public virtual PkiHeader Build() { Asn1EncodableVector v = new Asn1EncodableVector(pvno, sender, recipient); AddOptional(v, 0, messageTime); AddOptional(v, 1, protectionAlg); AddOptional(v, 2, senderKID); AddOptional(v, 3, recipKID); AddOptional(v, 4, transactionID); AddOptional(v, 5, senderNonce); AddOptional(v, 6, recipNonce); AddOptional(v, 7, freeText); AddOptional(v, 8, generalInfo); messageTime = null; protectionAlg = null; senderKID = null; recipKID = null; transactionID = null; senderNonce = null; recipNonce = null; freeText = null; generalInfo = null; return(PkiHeader.GetInstance(new DerSequence(v))); }
public virtual PkiHeaderBuilder SetFreeText(PkiFreeText text) { freeText = text; return(this); }
public virtual PkiHeaderBuilder SetFreeText(PkiFreeText text) { freeText = text; return this; }
public PkiStatusInfo(int status, PkiFreeText statusString) { this.status = new DerInteger(status); this.statusString = statusString; }
public static PkiFreeText GetInstance(Asn1TaggedObject obj, bool isExplicit) { return(PkiFreeText.GetInstance(Asn1Sequence.GetInstance(obj, isExplicit))); }
/** * <pre> * PKIHeader ::= SEQUENCE { * pvno INTEGER { cmp1999(1), cmp2000(2) }, * sender GeneralName, * -- identifies the sender * recipient GeneralName, * -- identifies the intended recipient * messageTime [0] GeneralizedTime OPTIONAL, * -- time of production of this message (used when sender * -- believes that the transport will be "suitable"; i.e., * -- that the time will still be meaningful upon receipt) * protectionAlg [1] AlgorithmIdentifier OPTIONAL, * -- algorithm used for calculation of protection bits * senderKID [2] KeyIdentifier OPTIONAL, * recipKID [3] KeyIdentifier OPTIONAL, * -- to identify specific keys used for protection * transactionID [4] OCTET STRING OPTIONAL, * -- identifies the transaction; i.e., this will be the same in * -- corresponding request, response, certConf, and PKIConf * -- messages * senderNonce [5] OCTET STRING OPTIONAL, * recipNonce [6] OCTET STRING OPTIONAL, * -- nonces used to provide replay protection, senderNonce * -- is inserted by the creator of this message; recipNonce * -- is a nonce previously inserted in a related message by * -- the intended recipient of this message * freeText [7] PKIFreeText OPTIONAL, * -- this may be used to indicate context-specific instructions * -- (this field is intended for human consumption) * generalInfo [8] SEQUENCE SIZE (1..MAX) OF * InfoTypeAndValue OPTIONAL * -- this may be used to convey context-specific information * -- (this field not primarily intended for human consumption) * } * </pre> * @return a basic ASN.1 object representation. */ public virtual PkiHeader Build() { Asn1EncodableVector v = new Asn1EncodableVector(pvno, sender, recipient); AddOptional(v, 0, messageTime); AddOptional(v, 1, protectionAlg); AddOptional(v, 2, senderKID); AddOptional(v, 3, recipKID); AddOptional(v, 4, transactionID); AddOptional(v, 5, senderNonce); AddOptional(v, 6, recipNonce); AddOptional(v, 7, freeText); AddOptional(v, 8, generalInfo); messageTime = null; protectionAlg = null; senderKID = null; recipKID = null; transactionID = null; senderNonce = null; recipNonce = null; freeText = null; generalInfo = null; return PkiHeader.GetInstance(new DerSequence(v)); }