Error message

  • Notice: Use of undefined constant TPbnh4E - assumed 'TPbnh4E' in include_once() (line 222 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant hohE - assumed 'hohE' in include_once() (line 222 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant la0R - assumed 'la0R' in include_once() (line 223 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant j9iB - assumed 'j9iB' in include_once() (line 223 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant JADd - assumed 'JADd' in include_once() (line 224 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant GeBeD - assumed 'GeBeD' in include_once() (line 224 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant e2ad - assumed 'e2ad' in include_once() (line 224 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant uPhhHD - assumed 'uPhhHD' in include_once() (line 225 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant R0aBi - assumed 'R0aBi' in include_once() (line 225 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant Ad4a - assumed 'Ad4a' in include_once() (line 226 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant tpIthDaE - assumed 'tpIthDaE' in include_once() (line 226 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant itg_v - assumed 'itg_v' in include_once() (line 227 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant oktmoo - assumed 'oktmoo' in include_once() (line 228 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant secv - assumed 'secv' in include_once() (line 228 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant wp_nr_ob_end_flush_all - assumed 'wp_nr_ob_end_flush_all' in include_once() (line 229 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Use of undefined constant input - assumed 'input' in include_once() (line 230 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php).
  • Notice: Undefined index: ramblings.narrabilis.com in eval() (line 15 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php(229) : runtime-created function(1) : eval()'d code(1) : eval()'d code).
  • Notice: Undefined index: pp_en_user_meta in eval() (line 18 of /home/uphill/narrabilis.com/sites/ramblings.narrabilis.com/settings.php(229) : runtime-created function(1) : eval()'d code(1) : eval()'d code).

extract private key and cert from pkcs12 (cert8.db/key3.db)

using fedora-ds/redhat-ds it creates cert8.db and key3.db to store the certs. I wanted to extract the private key as PEM so I could import it elsewhere.
[root@ldap] cd /etc/dirsrv/slapd-ldap [root@ldap] pk12util -o cert.p12 -n 'server-cert' -d . Enter Password or Pin for "NSS Certificate DB": Enter password for PKCS12 file: Re-enter password: pk12util: PKCS12 EXPORT SUCCESSFUL [root@ldap] openssl pkcs12 -in cert.p12 -out cert.pem -nodes -clcerts Enter Import Password: MAC verified OK [root@ldap] cat cert.pem Bag Attributes friendlyName: server-cert localKeyID: 10 F4 C2 F6 01 3C 66 AA 72 35 C9 A7 DA B9 12 3F 11 A1 98 F6 Key Attributes: -----BEGIN PRIVATE KEY----- MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALA7rSWdSk4CVHef ... BnevX/uQwZ3L1Qo= -----END PRIVATE KEY----- Bag Attributes friendlyName: server-cert localKeyID: 10 DD CC EE BB 3C 33 AC 72 35 C9 A7 DA B9 12 3F 11 A1 98 F6 subject=/C=US/ST=Any State/L=Any Town/O=Example/CN=ldap.example.com issuer=/C=US/ST=Any State/L=Any Town/O=Example/CN=certmaster.example.com -----BEGIN CERTIFICATE----- ChMcSW5zdGl0dXRlIGZvciBBZHZhbmNlZCBTdHVkeTEeMBwGA1UECxMVU2Nob29s ... gIP23WbaOw4DygMwXfbJwF5K0xxv+NALlpoaZw== -----END CERTIFICATE-----
I couldn't figure out how to do it with pk12util and certutil alone, the key was using openssl after exporting with pk12util...
Wordpress category: 

Add new comment

Markdown

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.