Exemplo n.º 1
0
 public ErrorMsgContent(PkiStatusInfo pkiStatusInfo, DerInteger errorCode, PkiFreeText errorDetails)
 {
     if (pkiStatusInfo == null)
     {
         throw new ArgumentNullException("pkiStatusInfo");
     }
     this.pkiStatusInfo = pkiStatusInfo;
     this.errorCode     = errorCode;
     this.errorDetails  = errorDetails;
 }
Exemplo n.º 2
0
    private PkiHeader(Asn1Sequence seq)
    {
        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("unknown tag number: " + asn1TaggedObject.TagNo, "seq");
            }
        }
    }
    public string GetStatusString()
    {
        if (resp.Status.StatusString == null)
        {
            return(null);
        }
        StringBuilder stringBuilder = new StringBuilder();
        PkiFreeText   statusString  = resp.Status.StatusString;

        for (int i = 0; i != statusString.Count; i++)
        {
            stringBuilder.Append(statusString[i].GetString());
        }
        return(stringBuilder.ToString());
    }
Exemplo n.º 4
0
        public string GetStatusString()
        {
            if (this.resp.Status.StatusString == null)
            {
                return(null);
            }
            StringBuilder stringBuilder = new StringBuilder();
            PkiFreeText   statusString  = this.resp.Status.StatusString;

            for (int num = 0; num != statusString.Count; num++)
            {
                stringBuilder.Append(statusString[num].GetString());
            }
            return(stringBuilder.ToString());
        }
Exemplo n.º 5
0
 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);
         }
     }
 }
Exemplo n.º 6
0
        public string GetStatusString()
        {
            if (resp.Status.StatusString == null)
            {
                return(null);
            }

            StringBuilder statusStringBuf = new StringBuilder();
            PkiFreeText   text            = resp.Status.StatusString;

            for (int i = 0; i != text.Count; i++)
            {
                statusStringBuf.Append(text[i].GetString());
            }

            return(statusStringBuf.ToString());
        }
Exemplo n.º 7
0
        public string GetStatusString()
        {
            //IL_0014: Unknown result type (might be due to invalid IL or missing references)
            //IL_001a: Expected O, but got Unknown
            if (resp.Status.StatusString == null)
            {
                return(null);
            }
            StringBuilder val          = new StringBuilder();
            PkiFreeText   statusString = resp.Status.StatusString;

            for (int i = 0; i != statusString.Count; i++)
            {
                val.Append(statusString[i].GetString());
            }
            return(val.ToString());
        }
 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);
         }
     }
 }
Exemplo n.º 9
0
    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 ProtectedPkiMessageBuilder SetFreeText(PkiFreeText freeText)
 {
     hdrBuilBuilder.SetFreeText(freeText);
     return(this);
 }
Exemplo n.º 11
0
 public virtual PkiHeaderBuilder SetFreeText(PkiFreeText text)
 {
     freeText = text;
     return(this);
 }
Exemplo n.º 12
0
 public PkiStatusInfo(int status, PkiFreeText statusString, PkiFailureInfo failInfo)
 {
     this.status       = new DerInteger(status);
     this.statusString = statusString;
     this.failInfo     = failInfo;
 }
Exemplo n.º 13
0
 public PkiStatusInfo(int status, PkiFreeText statusString)
 {
     this.status       = new DerInteger(status);
     this.statusString = statusString;
 }