예제 #1
0
        private CertifiedKeyPair(Asn1Sequence seq)
        {
            certOrEncCert = CertOrEncCert.GetInstance(seq[0]);

            if (seq.Count >= 2)
            {
                if (seq.Count == 2)
                {
                    Asn1TaggedObject tagged = Asn1TaggedObject.GetInstance(seq[1]);
                    if (tagged.TagNo == 0)
                    {
                        privateKey = EncryptedValue.GetInstance(tagged.GetObject());
                    }
                    else
                    {
                        publicationInfo = PkiPublicationInfo.GetInstance(tagged.GetObject());
                    }
                }
                else
                {
                    privateKey      = EncryptedValue.GetInstance(Asn1TaggedObject.GetInstance(seq[1]));
                    publicationInfo = PkiPublicationInfo.GetInstance(Asn1TaggedObject.GetInstance(seq[2]));
                }
            }
        }
예제 #2
0
 private CertOrEncCert(Asn1TaggedObject tagged)
 {
     if (tagged.TagNo == 0)
     {
         this.certificate = CmpCertificate.GetInstance(tagged.GetObject());
         return;
     }
     if (tagged.TagNo == 1)
     {
         this.encryptedCert = EncryptedValue.GetInstance(tagged.GetObject());
         return;
     }
     throw new ArgumentException("unknown tag: " + tagged.TagNo, "tagged");
 }
예제 #3
0
 private CertOrEncCert(Asn1TaggedObject tagged)
 {
     //IL_0055: Unknown result type (might be due to invalid IL or missing references)
     if (tagged.TagNo == 0)
     {
         certificate = CmpCertificate.GetInstance(tagged.GetObject());
         return;
     }
     if (tagged.TagNo == 1)
     {
         encryptedCert = EncryptedValue.GetInstance(tagged.GetObject());
         return;
     }
     throw new ArgumentException(string.Concat((object)"unknown tag: ", (object)tagged.TagNo), "tagged");
 }
예제 #4
0
 public static EncryptedKey GetInstance(object o)
 {
     if (o is EncryptedKey)
     {
         return((EncryptedKey)o);
     }
     if (o is Asn1TaggedObject)
     {
         return(new EncryptedKey(EnvelopedData.GetInstance((Asn1TaggedObject)o, explicitly: false)));
     }
     if (o is EncryptedValue)
     {
         return(new EncryptedKey((EncryptedValue)o));
     }
     return(new EncryptedKey(EncryptedValue.GetInstance(o)));
 }
예제 #5
0
 private CertifiedKeyPair(Asn1Sequence seq)
 {
     this.certOrEncCert = CertOrEncCert.GetInstance(seq[0]);
     if (seq.Count >= 2)
     {
         if (seq.Count == 2)
         {
             Asn1TaggedObject instance = Asn1TaggedObject.GetInstance(seq[1]);
             if (instance.TagNo == 0)
             {
                 this.privateKey = EncryptedValue.GetInstance(instance.GetObject());
                 return;
             }
             this.publicationInfo = PkiPublicationInfo.GetInstance(instance.GetObject());
             return;
         }
         else
         {
             this.privateKey      = EncryptedValue.GetInstance(Asn1TaggedObject.GetInstance(seq[1]));
             this.publicationInfo = PkiPublicationInfo.GetInstance(Asn1TaggedObject.GetInstance(seq[2]));
         }
     }
 }