public GetAttributes ( |
||
aa | ||
return | IDictionary |
public void GetAttributes_Test2 () { PKCS12 p12 = new PKCS12 (); X509Certificate x509 = new X509Certificate (cert); IDictionary attrs = new Hashtable (); ArrayList attrValues = new ArrayList (); attrValues.Add (Encoding.BigEndianUnicode.GetBytes ("Friendly name")); attrs.Add (PKCS9.friendlyName, attrValues); p12.AddCertificate (x509, attrs); AssertEquals ("GA2.1", p12.Certificates.Count, 1); IDictionary pattrs = p12.GetAttributes (x509); Assert ("GA2.2", pattrs.Contains (PKCS9.friendlyName)); }
static RSA GetKeyMatchingCertificate(MSX.PKCS12 pfx, MSX.X509Certificate cert) { IDictionary attributes = pfx.GetAttributes(cert); return(pfx.GetAsymmetricAlgorithm(attributes) as RSA); }
public void GetAttributes_Test1 () { PKCS12 p12 = new PKCS12 (); IDictionary attrs = new Hashtable (); ArrayList attrValues = new ArrayList (); attrValues.Add (Encoding.BigEndianUnicode.GetBytes ("Friendly name")); attrs.Add (PKCS9.friendlyName, attrValues); AsymmetricAlgorithm aa = RSA.Create (); p12.AddKeyBag (aa, attrs); AssertEquals ("GA1.1", p12.Keys.Count, 1); IDictionary pattrs = p12.GetAttributes (aa); Assert ("GA1.2", pattrs.Contains (PKCS9.friendlyName)); }