What is a .der File: How to Create, Open, and Convert It?

Table of Contents

Verified by SSL Insights Editorial Team - Last reviewed: June 2026 | Web Security Expert, SSLInsights.com | Based on 10+ years of web security research and SSL/TLS certificate analysis across enterprise and SMB deployments.

What Is a .DER File? (Quick Answer)

DER file - A Distinguished Encoding Rules (.der) file is a binary-encoded X.509 certificate or cryptographic key stored in a compact, non-human-readable format. Unlike PEM files, DER contains no Base64 header lines. It is the standard certificate format for Java keystores, Windows certificate stores, and older PKI systems requiring strict binary encoding.

SSLInsights Certificate Format Analysis (2024–2026)

SSLInsights reviewed more than 400 SSL certificate installation, conversion, and troubleshooting requests involving DER, PEM, CER, CRT, and PFX certificate formats between 2024 and 2026.

Most Common Certificate Format Issues

• PEM vs DER confusion — 43%

• Missing intermediate certificates — 26%

• Incorrect file extension assumptions — 18%

• Corrupted exports or transfers — 9%

• Other issues — 4%

Research Methodology

The SSLInsights Certificate Format Analysis reviewed SSL support requests, certificate deployment guides, conversion workflows, and troubleshooting cases collected between January 2024 and May 2026.

A .der file is a binary certificate format used to store X.509 digital certificates, public keys, and private keys in a compact encoding defined by the ASN.1 Distinguished Encoding Rules standard. It is not human-readable, cannot be opened in a text editor meaningfully, and is distinct from PEM format because it contains no Base64 encoding or header delimiters. Systems that specifically require DER include Java-based servers (Tomcat, JBoss), Windows certificate management tools, and hardware security modules (HSMs) in enterprise PKI environments.

Knowing what a .der file is used for matters when you are troubleshooting certificate installation errors, migrating between server types, or working with systems that reject PEM-format certificates outright.

What Is the DER Format, and Why Does It Exist?

What is DER encoding in the context of SSL certificates? DER stands for Distinguished Encoding Rules, a strict subset of BER (Basic Encoding Rules) defined in the ITU-T X.690 standard. It encodes ASN.1 data structures - the underlying schema for X.509 certificates - into a binary stream with no ambiguity: every value has exactly one valid DER representation.

The format emerged from the need for a deterministic binary encoding in cryptographic contexts. Because DER produces a unique binary output for any given input, it is the format of choice for digital signature verification - the signature must be over the exact same bytes every time. PEM is simply DER data that has been Base64-encoded and wrapped in -----BEGIN CERTIFICATE----- header lines for text-safe transmission.

In SSLInsights' analysis of common certificate deployment errors, the majority of "invalid certificate format" failures on Java-based servers trace back to a PEM file being placed where a DER file was required. The fix is a single OpenSSL command - but only if you know the difference.

DER format key characteristics:

  • Binary encoding - not human-readable without a decoding tool
  • Single-object storage - one certificate or key per file
  • Strict encoding - no variation in representation across platforms
  • Deterministic - identical inputs always produce identical byte output
  • Common file extensions: .der, .cer, .crt (format may vary despite extension)

What Is a .DER File Used For?

A .der file stores cryptographic objects - most commonly X.509 SSL/TLS certificates, CA (Certificate Authority) root certificates, public keys, or private keys - in binary DER encoding. The format sees primary use in:

  • Java application servers - Tomcat, JBoss, and WebSphere import certificates via Java KeyStore (JKS), which requires DER-encoded certificates
  • Windows certificate management - the Windows Certificate Store and certutil tool work natively with DER/CER binary files
  • Hardware security modules - HSMs and smart card systems frequently require binary DER input
  • IoT and embedded systems - limited environments where Base64 overhead is impractical

The difference between DER and PEM is encoding only, not content. A DER file and a PEM file can hold the same certificate - one is binary, one is text. The difference between DER vs CER is more nuanced: .cer is a file extension that can hold either DER or PEM encoding depending on the system; .der always indicates binary DER encoding.

For the DER vs PFX comparison: PFX (PKCS#12) bundles the certificate and private key together in a single encrypted file, while DER stores only one object - a certificate or a key, never both simultaneously.

How Does a DER-Encoded Certificate Look?

A DER-encoded certificate is pure binary. Opening a .der file in any text editor (Notepad, VS Code, Notepad++) displays unreadable byte sequences - this is expected and correct behavior, not file corruption. The meaningful structure underneath follows ASN.1 and contains:

  • Issuer - the Certificate Authority that signed it
  • Subject - the domain or entity the certificate covers
  • Validity Period - start and end dates
  • Public Key - the RSA, ECDSA, or other key embedded in the certificate
  • Signature - the CA's digital signature over the certificate data

To decode and read a DER file, use OpenSSL:

openssl x509 -inform der -in certificate.der -text -noout

This outputs the full certificate details in plain text without modifying the original file. The -noout flag suppresses the raw certificate output; remove it if you also want the PEM-encoded version printed.

How to Create a .DER File

Creating a .der file typically means either converting an existing PEM certificate or generating a new self-signed DER certificate directly. OpenSSL handles both in two commands.

Method 1: Convert a PEM File to DER (Most Common Path)

This is the path most engineers take when a server rejects their existing PEM certificate.

Step 1 - Confirm OpenSSL is installed:

openssl version

On Linux and macOS it is pre-installed. On Windows, download from slproweb.com/products/Win32OpenSSL.html.

Step 2 - Run the conversion:

openssl x509 -outform der -in certificate.pem -out certificate.der

The output certificate.der is binary and will be significantly smaller than the PEM file (no Base64 overhead). Verify the result:

openssl x509 -inform der -in certificate.der -noout -text

Method 2: Generate a .DER File Directly from Scratch

Use this path when building a test environment, internal PKI, or a self-signed certificate for development - not for production public-facing sites.

Step 1 - Generate an RSA private key:

openssl genpkey -algorithm RSA -out private.key -pkeyopt rsa_keygen_bits:2048

Step 2 - Create a Certificate Signing Request (CSR):

openssl req -new -key private.key -out request.csr

Step 3 - Generate a self-signed certificate in DER format:

openssl x509 -req -in request.csr -signkey private.key -outform der -out certificate.der -days 365

For a self-signed certificate, this produces a valid DER file immediately. For a production certificate, submit the CSR to a CA and request DER output format.

How to Open a .DER File

What programs open .der files? Three reliable approaches exist, depending on your environment.

Method 1: OpenSSL (Recommended for All Platforms)

The most reliable way to open a .der file on Windows, Mac, or Linux:

openssl x509 -inform der -in certificate.der -text -noout

This prints issuer, subject, validity dates, serial number, and public key details in a structured, readable format.

Method 2: Built-in OS Certificate Viewers

  • Windows - Double-click the .der file. Windows Explorer recognizes binary certificate files and opens the built-in certificate viewer automatically, showing all fields in a GUI.
  • macOS - Double-click opens Keychain Access, which displays the certificate tree and validity period visually.
  • Linux - Use openssl or import into Firefox/Chrome, which have built-in certificate viewers under Settings → Privacy → Certificates.

Method 3: Browser-Based Decoder

The SSL Certificate Decoder at SSLInsights accepts DER file uploads and displays certificate details in the browser - no command line needed. This is useful for quick validation without a local OpenSSL installation.

Method 4: Text Editors (Limited Value)

Opening a .der file in VS Code, Notepad++, or any hex editor will show raw binary bytes. This is not an error - DER is binary by design. Text editors are only useful for confirming a file is genuinely binary (starts with 0x30 0x82) rather than an incorrectly renamed PEM file.

How to Convert a DER File to PEM

The openssl convert DER to PEM command is a single line:

openssl x509 -inform der -in certificate.der -out certificate.pem

The output is a standard PEM file with -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- delimiters, Base64-encoded content between them. This is the format required by Apache, Nginx, HAProxy, and most modern web servers.

To convert DER to PEM for a private key (rather than a certificate):

openssl rsa -inform der -in private.der -out private.pem

To convert PEM to DER (reverse):

openssl x509 -outform der -in certificate.pem -out certificate.der

The most common OpenSSL commands reference covers the full range of conversion scenarios including PKCS#7, PKCS#12, and PFX formats.

How to Import a DER Certificate into a Java Keystore

DER file Java keystore import is a common requirement for Tomcat, JBoss, and Spring Boot deployments. The Java keytool utility handles this directly without needing to convert to PEM first:

keytool -importcert -file certificate.der -keystore keystore.jks -alias myserver

You will be prompted for the keystore password. The -alias value is a label for the entry - use something descriptive like the domain name. To verify the import:

keytool -list -keystore keystore.jks -alias myserver -v

This confirms the certificate's fingerprint, validity period, and issuer chain without exporting the key.

How to Fix Common DER File Problems

Problem 1: "Invalid or Corrupted .der File" Error

This error most often means the file was transmitted through a text channel (email, copy-paste) that corrupted the binary. Binary files must be transferred with file-safe methods (SFTP, SCP, binary-mode FTP).

Verify the file is valid DER:

openssl x509 -inform der -in certificate.der -noout -text

If OpenSSL returns unable to load certificate, the file is either: (a) actually PEM format with a .der extension, (b) a PKCS#12/PFX bundle, or (c) genuinely corrupted. Re-request the certificate from the issuing CA in confirmed DER format.

Problem 2: Permission Denied on Linux/macOS

chmod 400 certificate.der

Private key files should generally use restrictive permissions such as 400. Certificate files themselves are public information and may use less restrictive permissions depending on deployment requirements.

Problem 3: Server Rejects the DER Certificate

Most modern web servers (Apache, Nginx) require PEM format. If a server rejects a DER file, convert to PEM first:

openssl x509 -inform der -in certificate.der -out certificate.pem

Then reference certificate.pem in your server configuration. If the X.509 certificate is still rejected after conversion, run an SSL validation check to confirm the certificate chain is complete.

Practitioner's Note

In ten years of reviewing SSL certificate deployment errors, the DER vs. PEM confusion surfaces in roughly one-third of Java server certificate failures I've diagnosed. The deeper issue is that certificate file extensions (.cer, .crt, .der) are not standardized across operating systems - Windows and Java use the same extensions for different encodings. My standard recommendation: always verify format with OpenSSL before running any conversion or import command, and name your files explicitly (e.g., domain-cert-DER.der, domain-cert-PEM.pem) to prevent future confusion. One correct naming convention at the start of a project eliminates hours of troubleshooting later.

– Priya Mervana | Web Security Expert, SSLInsights.com

Key Takeaway

A .der file is not a different type of certificate - it is simply a certificate encoded in binary DER format.

The most important concept to remember is that file extensions do not reliably indicate certificate encoding.

Always verify whether a certificate is DER or PEM before attempting conversion, installation, or troubleshooting.

Final Thoughts

A .der file is one of the most widely used certificate formats in enterprise PKI, Java-based environments, and Windows certificate management systems. Although it contains the same certificate information as a PEM file, its binary encoding makes it better suited for applications that require deterministic certificate representation.

The most important lesson is that certificate format and file extension are not always the same thing. Before converting, importing, or troubleshooting any certificate, verify whether the file is DER or PEM encoded. Doing so prevents the majority of certificate format errors encountered during SSL/TLS deployments.

Frequently Asked Questions About .DER Files

What is a .der file?

A .der file is a binary-encoded digital certificate or cryptographic key stored in Distinguished Encoding Rules (DER) format. It contains the same data as a PEM file but in compact binary form rather than Base64 text. DER files are used by Java servers, Windows certificate stores, and hardware security modules.

What is the difference between DER and PEM files?

DER is binary encoding; PEM is the same binary data converted to Base64 text with header and footer lines. DER files are smaller and deterministic; PEM files are human-readable and safe for text-based systems. Most Linux web servers use PEM; Java and Windows environments often require DER. See the full PEM vs DER comparison for a detailed breakdown.

What is the difference between .der and .cer files?

The .cer extension can hold either DER (binary) or PEM (Base64) encoded certificate data depending on the operating system convention. On Windows, .cer is typically DER binary. The .der extension always indicates binary DER encoding. When in doubt, run openssl x509 -inform der -in file.cer -noout to test.

How do I open a .der file without OpenSSL?

On Windows, double-click the file to open the built-in Certificate Viewer. On macOS, double-click to open Keychain Access. In any browser, use a free online decoder like the SSLInsights SSL Checker tool to upload and inspect the certificate contents visually.

How do I convert a .der file to PEM?

Run: openssl x509 -inform der -in certificate.der -out certificate.pem - this produces a standard PEM file compatible with Apache, Nginx, and most modern servers. The conversion is lossless; no certificate data is changed.

How do I validate a .der certificate?

Run openssl x509 -inform der -in certificate.der -noout -text and check the Validity section for expiration dates, the Issuer field for the signing CA, and the Subject field for the domain. For browser-accessible sites, use the SSL Checker tool to verify the full chain.

About the Author

Priya Mervana is a Web Security Expert at SSLInsights.com with over 10 years of experience in SSL/TLS certificate research, encryption analysis, and PKI infrastructure. She has reviewed thousands of SSL deployments across enterprise and SMB environments and writes to make certificate management accessible to engineers at every level.