Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>BouncyCastle's Pkcs12Store takes care of setting both the Friendly Name and Local Key ID attributes for you (or at least it does so in the 1.7 release, circa April 2011). My guess is that you must have used an older version where this didn't work.</p> <p>Here's how I'm saving an iPhone Developer identity to a Pkcs12Store instance (extra stuff and security omitted):</p> <pre class="lang-cs prettyprint-override"><code>var store = new Pkcs12Store(); // pairs is IEnumerable&lt;Tuple&lt;X509Certificate, AsymmetricKeyParameter&gt;&gt; foreach (var pair in pairs) { var cn = pair.Item1.SubjectDN .GetValueList(X509Name.CN).OfType&lt;string&gt;().Single(); var certEntry = new X509CertificateEntry(pair.Item1); store.SetCertificateEntry(cn, certEntry); var keyEntry = new AsymmetricKeyEntry(pair.Item2); store.SetKeyEntry("Developer Name", keyEntry, new[] { certEntry }); } store.Save(stream, string.Empty.ToArray(), new SecureRandom()); </code></pre> <p>Importing the store in Keychain Access.app on OS X 10.7 correctly places the certificate and private key in the keychain and places the certificate within the private key in the UI, as with a certificate and key generated by Keychain Access itself.</p> <p>On a side note, it seems that Pkcs12Store uses the public key of the certificate to generate the value of the LocalKeyId attribute shared by the certificate and key entries.</p> <p>You can see the relevant section of the Pkcs12Store source <a href="http://www.koders.com/csharp/fid0136A56D94002FC6D28B6083C2D13CCB1ACECA5C.aspx?s=GOST3411#L820" rel="nofollow">here</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload