GetAsymmetricAlgorithm() 공개 메소드

public GetAsymmetricAlgorithm ( IDictionary attrs ) : AsymmetricAlgorithm
attrs IDictionary
리턴 System.Security.Cryptography.AsymmetricAlgorithm
예제 #1
0
        static RSA GetKeyMatchingCertificate(MSX.PKCS12 pfx, MSX.X509Certificate cert)
        {
            IDictionary attributes = pfx.GetAttributes(cert);

            return(pfx.GetAsymmetricAlgorithm(attributes) as RSA);
        }
예제 #2
0
		public void GetAsymmetricAlgorithm_Test ()
		{
			PKCS12 p12 = new PKCS12 ();

			IDictionary attrs = new Hashtable ();
			ArrayList attrValues = new ArrayList ();
			attrValues.Add (Encoding.BigEndianUnicode.GetBytes ("Friendly name"));
			attrs.Add (PKCS9.friendlyName, attrValues);

			p12.AddKeyBag (RSA.Create (), attrs);

			AssertEquals ("GA.1", p12.Keys.Count, 1);

			AsymmetricAlgorithm aa = p12.GetAsymmetricAlgorithm (attrs);

			AssertNotNull ("GA.2", aa);
		}