Inheritance: Asn1Encodable
Exemplo n.º 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]));
				}
			}
		}
Exemplo n.º 2
0
		public CertOrEncCert(EncryptedValue encryptedCert)
		{
			if (encryptedCert == null)
				throw new ArgumentNullException("encryptedCert");

			this.encryptedCert = encryptedCert;
		}
Exemplo n.º 3
0
		public CertifiedKeyPair(
			CertOrEncCert		certOrEncCert,
			EncryptedValue		privateKey,
			PkiPublicationInfo	publicationInfo
		)
		{
			if (certOrEncCert == null)
				throw new ArgumentNullException("certOrEncCert");

			this.certOrEncCert = certOrEncCert;
			this.privateKey = privateKey;
			this.publicationInfo = publicationInfo;
		}
Exemplo n.º 4
0
		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");
			}
		}
Exemplo n.º 5
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)));
 }
Exemplo n.º 6
0
 public EncryptedKey(EncryptedValue encryptedValue)
 {
     this.encryptedValue = encryptedValue;
 }
Exemplo n.º 7
0
 public EncryptedKey(EncryptedValue encryptedValue)
 {
     this.encryptedValue = encryptedValue;
 }