<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: PKIScope</title>
    <description>The latest articles on DEV Community by PKIScope (pkiscope).</description>
    <link>https://dev.to/pkiscope</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F16046%2Fd8bee26f-3771-46a5-bd21-374a9aed8410.png</url>
      <title>DEV Community: PKIScope</title>
      <link>https://dev.to/pkiscope</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pkiscope"/>
    <language>en</language>
    <item>
      <title>How to Inspect a JKS Keystore with keytool</title>
      <dc:creator>Jitendra Singh Bisht</dc:creator>
      <pubDate>Sat, 14 Nov 2026 17:00:57 +0000</pubDate>
      <link>https://dev.to/pkiscope/how-to-inspect-a-jks-keystore-with-keytool-5gfk</link>
      <guid>https://dev.to/pkiscope/how-to-inspect-a-jks-keystore-with-keytool-5gfk</guid>
      <description>&lt;p&gt;Your Java application is configured to use the alias &lt;code&gt;server&lt;/code&gt;. The alias exists, but does it contain the private key the application needs for TLS?&lt;/p&gt;

&lt;p&gt;Start by inspecting that specific entry with the &lt;code&gt;keytool&lt;/code&gt; from your application’s JDK:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;keytool -list -v -storetype JKS -keystore app.jks -alias server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enter the store password when prompted. Replace &lt;code&gt;server&lt;/code&gt; with the alias in your application configuration. If you’re unsure which alias to check, omit &lt;code&gt;-alias server&lt;/code&gt; to list all entries.&lt;/p&gt;

&lt;h3&gt;
  
  
  Read the entry type first
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;PrivateKeyEntry&lt;/code&gt;&lt;/strong&gt; contains a private key and its certificate chain. A TLS server or mTLS client uses this kind of entry for its own identity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;trustedCertEntry&lt;/code&gt;&lt;/strong&gt; contains a certificate trusted by the application. You’ll commonly find these entries in a truststore.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a &lt;code&gt;PrivateKeyEntry&lt;/code&gt;, check the certificate fingerprint, expiry date, and chain length. A chain length of &lt;code&gt;1&lt;/code&gt; is expected for a self-signed identity. For a CA-issued certificate, check whether the required intermediates are present.&lt;/p&gt;

&lt;p&gt;The store password and the private-key password can differ in JKS. A successful listing confirms you can read the store. If the application throws &lt;code&gt;UnrecoverableKeyException&lt;/code&gt;, check the password configured for the key entry separately.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verify the alias after converting to PKCS#12
&lt;/h3&gt;

&lt;p&gt;If you migrate the entry with &lt;code&gt;keytool -importkeystore&lt;/code&gt;, inspect the destination before switching the application over:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;keytool -list -v -storetype PKCS12 -keystore app.p12 -alias server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compare the entry type, chain length, and certificate fingerprints with the source. Then test the new keystore in the target Java runtime.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://pkiscope.com/guides/inspect-jks-keystore-keytool" rel="noopener noreferrer"&gt;full PKIScope walkthrough&lt;/a&gt; includes the commands to export the public certificate and convert a single JKS alias to PKCS#12.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;AI was used to draft this post. The inspection and conversion workflow was tested with JDK 21.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>security</category>
      <category>devops</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Fix RC2-40-CBC Errors When Opening a PFX in OpenSSL 3</title>
      <dc:creator>Jitendra Singh Bisht</dc:creator>
      <pubDate>Fri, 13 Nov 2026 02:42:44 +0000</pubDate>
      <link>https://dev.to/pkiscope/fix-rc2-40-cbc-errors-when-opening-a-pfx-in-openssl-3-29eg</link>
      <guid>https://dev.to/pkiscope/fix-rc2-40-cbc-errors-when-opening-a-pfx-in-openssl-3-29eg</guid>
      <description>&lt;p&gt;If &lt;code&gt;openssl pkcs12&lt;/code&gt; fails with an error containing &lt;code&gt;unsupported&lt;/code&gt; and &lt;code&gt;Algorithm (RC2-40-CBC : 0)&lt;/code&gt;, check the encryption used by the PFX archive. OpenSSL 3 supplies RC2 through its legacy provider.&lt;/p&gt;

&lt;h3&gt;
  
  
  Inspect the old PFX without exporting credentials
&lt;/h3&gt;

&lt;p&gt;For an archive you’re authorized to inspect, load the legacy provider for this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openssl pkcs12 -legacy -in old.pfx -info -noout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enter the archive password at the prompt. &lt;code&gt;-info&lt;/code&gt; reports the archive structure and encryption algorithms. &lt;code&gt;-noout&lt;/code&gt; suppresses certificate and key output.&lt;/p&gt;

&lt;p&gt;If you see &lt;code&gt;Mac verify error: invalid password?&lt;/code&gt;, check the password and try a fresh export from the source system. Keep integrity verification enabled.&lt;/p&gt;

&lt;h3&gt;
  
  
  Re-export with modern encryption
&lt;/h3&gt;

&lt;p&gt;If the consuming application supports modern PKCS#12 encryption, re-export the identity into a fresh archive using OpenSSL 3 defaults. For a bundle with one identity, extract the leaf certificate, any intermediates you need to retain, and an encrypted PEM copy of the private key. Work in a private directory and keep the original archive for rollback.&lt;/p&gt;

&lt;p&gt;After re-exporting, check that the new archive opens with the default provider:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openssl pkcs12 -in modern.p12 -info -noout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compare the leaf’s SHA-256 fingerprint with the original, confirm the expected intermediates are present, and test the new archive in the application that will use it. Repacking changes the archive encryption. The certificates and their signatures stay the same.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://pkiscope.com/guides/openssl-legacy-pfx-rc2-error" rel="noopener noreferrer"&gt;full PKIScope walkthrough&lt;/a&gt; includes the extraction, re-export, and fingerprint comparison commands.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;AI was used to draft this post. The RC2 failure and re-export workflow were tested with OpenSSL 3.5.7.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>openssl</category>
      <category>security</category>
      <category>devops</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Inspect a PFX or P12 File Without Exporting the Private Key</title>
      <dc:creator>Jitendra Singh Bisht</dc:creator>
      <pubDate>Thu, 12 Nov 2026 06:43:41 +0000</pubDate>
      <link>https://dev.to/pkiscope/how-to-inspect-a-pfx-or-p12-file-without-exporting-the-private-key-18n4</link>
      <guid>https://dev.to/pkiscope/how-to-inspect-a-pfx-or-p12-file-without-exporting-the-private-key-18n4</guid>
      <description>&lt;p&gt;Someone hands you a &lt;code&gt;.pfx&lt;/code&gt; file and asks whether it’s the right certificate for a deployment. Before extracting anything, check what the bundle contains.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openssl pkcs12 -in bundle.p12 -info -noout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OpenSSL prompts for the archive password and reports the bag types and encryption algorithms. A &lt;code&gt;Shrouded Keybag&lt;/code&gt; indicates an encrypted private-key bag. &lt;code&gt;Certificate bag&lt;/code&gt; lines indicate certificates. The &lt;code&gt;-noout&lt;/code&gt; flag suppresses credential output.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check the certificate’s DNS names and expiry
&lt;/h3&gt;

&lt;p&gt;For an archive with one identity, extract the public certificate and inspect it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openssl pkcs12 -in bundle.p12 -clcerts -nokeys -out leaf.pem
openssl x509 -in leaf.pem -noout -subject -issuer -dates -ext subjectAltName
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the Subject Alternative Name against the hostname your client uses. Check both validity dates, especially if the certificate was just issued. If the archive contains several identities, match the certificate to the expected entry before running &lt;code&gt;openssl x509&lt;/code&gt;, which reads the first certificate in the PEM file.&lt;/p&gt;

&lt;h3&gt;
  
  
  What if OpenSSL reports &lt;code&gt;RC2-40-CBC&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;For a legacy archive you’re authorized to inspect, try loading the legacy provider for this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openssl pkcs12 -legacy -in bundle.p12 -info -noout
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the consuming application supports modern PKCS#12 encryption, re-export the archive with modern defaults and verify the certificate and chain before switching over.&lt;/p&gt;

&lt;p&gt;I maintain PKIScope. The &lt;a href="https://pkiscope.com/guides/how-to-open-pfx-p12-file" rel="noopener noreferrer"&gt;original PFX/P12 guide&lt;/a&gt; also covers inspecting intermediates and comparing the archive with what your TLS server actually presents.&lt;/p&gt;

</description>
      <category>openssl</category>
      <category>security</category>
      <category>devops</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
