Overview
A certificate authority sends you three PEM files:
server.crt
intermediate-ca.crt
root-ca.crtYour Linux tools are perfectly happy with them.
Then the administrator of another system asks:
Can you send me the certificate chain as a
.p7bfile?
This is where:
openssl crl2pkcs7becomes useful.
The command can take one or more PEM certificates and optionally a Certificate Revocation List and place them into a PKCS#7 structure.
The resulting file can be encoded as:
PEMor:
DERand may use familiar extensions such as:
.p7b
.p7c
.p7The official OpenSSL crl2pkcs7 documentation describes the output as a PKCS#7 SignedData structure containing certificates and optionally a CRL, but no signers.
This guide uses a practical system-administration scenario:
An administrator has a server certificate, intermediate CA, and root CA in separate PEM files. A destination system requires the complete certificate chain as a DER-encoded PKCS#7
.p7bfile.
We will use OpenSSL to:
- inspect the source certificates;
- verify the certificate chain;
- create a PKCS#7 certificate bundle;
- create a Windows-friendly DER
.p7b; - inspect the resulting PKCS#7 file;
- extract the certificates back to PEM;
- include a CRL when necessary;
- convert a DER CRL before using it;
- handle multiple certificate files;
- troubleshoot common
crl2pkcs7errors.
What does openssl crl2pkcs7 do?
The command syntax is:
openssl crl2pkcs7 [options]Despite its name, a CRL is optional.
This is probably the most important thing to understand about the command.
With:
-nocrlyou can use crl2pkcs7 simply to package certificates into PKCS#7.
For example:
openssl crl2pkcs7 \
-nocrl \
-certfile server.crt \
-certfile intermediate-ca.crt \
-certfile root-ca.crt \
-out chain.p7bOpenSSL documents -certfile as accepting one or more PEM certificates, and the option may be specified multiple times.
Why is it called crl2pkcs7 if I don’t need a CRL?
Historically, the command was designed to construct a PKCS#7 structure from:
certificate(s)
+
optional CRLBy default, OpenSSL expects a CRL.
The:
-nocrloption tells OpenSSL not to read one.
That makes the command useful for the much more common administrator task of building a certificate-only PKCS#7 bundle.
The resulting object is sometimes called a degenerate SignedData structure because it uses the PKCS#7 SignedData container but contains no actual signer information.
What is a PKCS#7 certificate bundle?
PKCS#7 can contain multiple certificates in one structure.
For example:
PKCS#7
├── Server Certificate
├── Intermediate CA
└── Root CAA .p7b file normally does not contain the server’s private key.
This makes PKCS#7 fundamentally different from PKCS#12.
PKCS#7
Commonly contains:
certificates
certificate chains
optional CRLsbut no private key in the certificate-only bundle created by crl2pkcs7.
PKCS#12
Commonly contains:
private key
certificate
certificate chainwith extensions such as:
.p12
.pfxFor more on PKCS#7 structures, see PKCS7 as SignedData and a Certificate Bundle. Your existing MisterPKI guide already covers inspecting and extracting certificates from P7B bundles.
OpenSSL version compatibility
This guide applies to:
- OpenSSL 3.0;
- OpenSSL 3.1;
- OpenSSL 3.2;
- OpenSSL 3.3;
- OpenSSL 3.4;
- OpenSSL 3.5 LTS;
- OpenSSL 4.0.
Check your version:
openssl versionFor detailed build information:
openssl version -aThe core command syntax is essentially unchanged across OpenSSL 3.0, 3.5, and 4.0:
openssl crl2pkcs7 \
-nocrl \
-certfile certificate.pem \
-out bundle.p7bThe common options include:
-inform
-outform
-in
-out
-certfile
-nocrl
-provider
-provider-path
-propqueryOpenSSL 3.5 and OpenSSL 4.0 additionally document:
-provparamfor provider configuration.
For ordinary certificate-bundle creation, these version differences do not materially change the workflow.
Real-world scenario
Assume you have:
server.crt
intermediate-ca.crt
root-ca.crtAll three are PEM-encoded X.509 certificates.
A destination system expects:
server-chain.p7bin binary DER format.
The desired bundle is:
server.crt
↓
intermediate-ca.crt
↓
root-ca.crt
↓
PKCS#7 / P7BBefore creating the bundle, verify that the files actually belong together.
Step 1: Confirm each file is a certificate
Check the server certificate:
openssl x509 \
-in server.crt \
-noout \
-subject \
-issuer \
-serial \
-datesDo the same for the intermediate:
openssl x509 \
-in intermediate-ca.crt \
-noout \
-subject \
-issuer \
-serial \
-datesAnd the root:
openssl x509 \
-in root-ca.crt \
-noout \
-subject \
-issuer \
-serial \
-datesYou should be able to follow the relationship:
Server issuer
=
Intermediate subject
Intermediate issuer
=
Root subjectA root CA is normally self-signed, so its:
subjectand:
issuernormally match.
For a deeper explanation of this relationship, see Certificate Chains Explained.
Step 2: Verify the chain before packaging it
Do not assume that placing three certificates into one P7B file makes them a valid certificate chain.
Verify them first:
openssl verify \
-CAfile root-ca.crt \
-untrusted intermediate-ca.crt \
server.crtExpected:
server.crt: OKIf this fails, fix the chain before creating the PKCS#7 bundle.
For more certificate-chain troubleshooting, see OpenSSL Verify: Certificate, Chain, CRL, and Key Examples.
Step 3: Create a PEM PKCS#7 certificate bundle
Create the simplest certificate-only bundle:
openssl crl2pkcs7 \
-nocrl \
-certfile server.crt \
-certfile intermediate-ca.crt \
-certfile root-ca.crt \
-out server-chain.p7bBecause no:
-outformwas specified, OpenSSL uses PEM output by default.
Inspect the beginning:
head server-chain.p7bYou should see a PEM PKCS#7 header similar to:
-----BEGIN PKCS7-----This file can contain all three certificates inside one PKCS#7 structure.
Step 4: Create a DER-encoded P7B file
Many Windows and enterprise applications expect .p7b files in binary DER format.
Use:
openssl crl2pkcs7 \
-nocrl \
-certfile server.crt \
-certfile intermediate-ca.crt \
-certfile root-ca.crt \
-outform DER \
-out server-chain.p7bThe output is now binary.
Check it:
file server-chain.p7bDo not expect:
cat server-chain.p7bto produce readable output.
DER is binary ASN.1 encoding.
Step 5: Inspect the resulting PKCS#7 bundle
Use the related:
openssl pkcs7command.
For a DER bundle:
openssl pkcs7 \
-inform DER \
-in server-chain.p7b \
-print_certs \
-nooutYou should see the subject and issuer for every certificate.
For example:
subject=CN=app.example.internal
issuer=CN=Example Issuing CA
subject=CN=Example Issuing CA
issuer=CN=Example Root CA
subject=CN=Example Root CA
issuer=CN=Example Root CAThis is one of the most important checks after creating the bundle.
Do not simply assume all certificates were added correctly.
Step 6: Display complete certificate details from the P7B
Use:
openssl pkcs7 \
-inform DER \
-in server-chain.p7b \
-print_certs \
-text \
-nooutThis can display:
- subjects;
- issuers;
- validity dates;
- public keys;
- X.509 extensions;
- signature algorithms.
For a large bundle, the output may be extensive.
For a quick inventory, prefer:
openssl pkcs7 \
-inform DER \
-in server-chain.p7b \
-print_certs \
-nooutStep 7: Extract the certificates back to PEM
A useful validation test is to extract the certificates:
openssl pkcs7 \
-inform DER \
-in server-chain.p7b \
-print_certs \
-out extracted-chain.pemInspect:
grep -- 'BEGIN CERTIFICATE' extracted-chain.pemIf the bundle contains three certificates, you should see three:
-----BEGIN CERTIFICATE-----entries.
Count them:
grep -c \
'BEGIN CERTIFICATE' \
extracted-chain.pemExpected:
3This gives you confidence that the PKCS#7 bundle contains the intended number of certificates.
Step 8: Use one certificate file containing multiple certificates
The:
-certfileoption accepts a PEM file containing one or more certificates. OpenSSL adds all certificates found in that file to the PKCS#7 structure.
Suppose:
chain.pemcontains:
-----BEGIN CERTIFICATE-----
server certificate
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
intermediate certificate
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
root certificate
-----END CERTIFICATE-----Then run:
openssl crl2pkcs7 \
-nocrl \
-certfile chain.pem \
-outform DER \
-out server-chain.p7bThis can be easier than supplying three separate:
-certfileoptions.
Step 9: Build the PEM chain file
If your certificates are already separate:
cat \
server.crt \
intermediate-ca.crt \
root-ca.crt \
> chain.pemConfirm:
grep -c \
'BEGIN CERTIFICATE' \
chain.pemExpected:
3Then package:
openssl crl2pkcs7 \
-nocrl \
-certfile chain.pem \
-outform DER \
-out server-chain.p7bAgain, remember:
concatenating certificates creates a PEM certificate bundle;
crl2pkcs7creates an actual PKCS#7 structure.
They are not the same format.
Step 10: Include a CRL
The command can also include a Certificate Revocation List.
Assume you have:
issuing-ca.crlInspect it first:
openssl crl \
-in issuing-ca.crl \
-noout \
-issuer \
-lastupdate \
-nextupdateThen create:
openssl crl2pkcs7 \
-in issuing-ca.crl \
-certfile server.crt \
-certfile intermediate-ca.crt \
-certfile root-ca.crt \
-outform DER \
-out server-chain-with-crl.p7bWithout:
-nocrlOpenSSL reads the CRL supplied through:
-inand includes it in the output PKCS#7 structure.
Step 11: Why would you include a CRL?
A CRL contains information about certificates revoked by a certificate authority.
Bundling a CRL with certificates may be useful when:
- an application expects certificate and revocation data together;
- transferring PKI material into an isolated environment;
- working with a legacy enrollment process;
- supplying certificate-chain information to software that consumes PKCS#7 structures.
However, including a CRL does not automatically cause every application importing the P7B to perform revocation checking.
The consuming software determines how it uses the included CRL.
For practical revocation verification, see OpenSSL verify.
Step 12: View the CRL before adding it
Use:
openssl crl \
-in issuing-ca.crl \
-noout \
-textLook for:
Issuer
Last Update
Next Update
Revoked Certificates
CRL NumberYou can also use the MisterPKI SSL Tools CRL decoder to inspect a PEM CRL.
Never package an unknown CRL simply because it was delivered alongside a certificate.
Confirm that its issuer corresponds to the CA whose revocation information you intend to distribute.
Step 13: Convert a DER CRL before using it
The:
-informoption controls the format of the CRL supplied through:
-inIf the CRL is binary DER:
openssl crl2pkcs7 \
-inform DER \
-in issuing-ca.crl \
-certfile chain.pem \
-outform DER \
-out chain-with-crl.p7bYou do not necessarily need to convert the CRL first.
However, if you want a PEM copy for troubleshooting:
openssl crl \
-inform DER \
-in issuing-ca.crl \
-outform PEM \
-out issuing-ca.pem.crlThen inspect:
openssl crl \
-in issuing-ca.pem.crl \
-noout \
-issuer \
-lastupdate \
-nextupdateImportant: -inform controls the CRL, not the certificates
This is easy to misunderstand.
The:
-inform DERor:
-inform PEMsetting describes the CRL supplied through:
-inThe certificate files supplied through:
-certfilemust be PEM encoded. OpenSSL’s documentation explicitly defines -certfile as a file containing one or more certificates in PEM format.
So this is not valid merely because you specified:
-inform DERopenssl crl2pkcs7 \
-nocrl \
-inform DER \
-certfile certificate.derConvert the certificate first:
openssl x509 \
-inform DER \
-in certificate.der \
-outform PEM \
-out certificate.pemThen:
openssl crl2pkcs7 \
-nocrl \
-certfile certificate.pem \
-outform DER \
-out certificate.p7bStep 14: Convert PEM certificates to a P7B
This is probably the most common real-world use of crl2pkcs7.
Given:
server.pem
intermediate.pem
root.pemrun:
openssl crl2pkcs7 \
-nocrl \
-certfile server.pem \
-certfile intermediate.pem \
-certfile root.pem \
-outform DER \
-out certificate-chain.p7bThen verify the contents:
openssl pkcs7 \
-inform DER \
-in certificate-chain.p7b \
-print_certs \
-nooutThis is the practical PEM-to-P7B conversion workflow.
Step 15: Convert a PEM PKCS#7 file to DER
If you already have:
certificate-chain.pem.p7bin PEM PKCS#7 format, use:
openssl pkcs7 \
-inform PEM \
-in certificate-chain.pem.p7b \
-outform DER \
-out certificate-chain.p7bYou do not need crl2pkcs7 merely to change an existing PKCS#7 object’s encoding.
Use:
openssl pkcs7for an existing PKCS#7 structure.
Use:
openssl crl2pkcs7when constructing a new PKCS#7 structure from certificates and an optional CRL.
Step 16: Convert P7B back to PEM certificates
Given:
certificate-chain.p7brun:
openssl pkcs7 \
-inform DER \
-in certificate-chain.p7b \
-print_certs \
-out certificate-chain.pemThe output contains consecutive PEM certificates.
Inspect:
grep \
-E 'subject=|issuer=' \
certificate-chain.pemOr split the certificates into separate files if the destination requires them individually.
Your existing PKCS#7 guide covers this reverse conversion in more detail.
Step 17: Certificate order in the bundle
When creating a certificate chain bundle, a sensible order is:
Leaf certificate
Intermediate CA
Root CAFor example:
openssl crl2pkcs7 \
-nocrl \
-certfile server.crt \
-certfile intermediate-ca.crt \
-certfile root-ca.crt \
-outform DER \
-out chain.p7bThis makes the bundle easier for administrators to inspect and understand.
However, PKCS#7 is fundamentally a collection of certificates rather than a guarantee that consuming applications will treat their physical sequence as authoritative chain-building order.
The certificate:
issuerand:
subjectrelationships are what define the chain cryptographically.
Always verify the chain independently with:
openssl verifybefore distribution.
Step 18: Should the root certificate be included?
It depends on the destination.
A complete P7B may contain:
server
intermediate
rootbut many TLS deployments only require:
server
intermediatebecause the client is expected to already trust the root certificate.
For importing a complete PKI chain into another management system, including the root may be useful.
For configuring a web server, sending the root as part of the TLS server chain is normally unnecessary.
Think about the goal:
Import complete chain?
↓
Root may be useful
Configure TLS server chain?
↓
Usually leaf + intermediatesDo not automatically add every certificate you have.
Step 19: Create an intermediate-only P7B
Some systems request only CA certificates.
Create:
openssl crl2pkcs7 \
-nocrl \
-certfile intermediate-ca.crt \
-certfile root-ca.crt \
-outform DER \
-out ca-chain.p7bInspect:
openssl pkcs7 \
-inform DER \
-in ca-chain.p7b \
-print_certs \
-nooutThis is useful when the destination already has the server or client certificate but requires the CA chain separately.
Step 20: Create a certificate-only P7B without the root
For a server plus intermediate:
openssl crl2pkcs7 \
-nocrl \
-certfile server.crt \
-certfile intermediate-ca.crt \
-outform DER \
-out server-and-intermediate.p7bThis can be appropriate when the destination already trusts the root CA.
Step 21: Understand what -nocrl actually does
If you run:
openssl crl2pkcs7 \
-certfile chain.pem \
-out bundle.p7bwithout:
-nocrlOpenSSL expects a CRL from:
-inor standard input.
That can lead to confusing behavior when you only intended to package certificates.
For certificate-only bundles, explicitly use:
-nocrlThis makes the administrator’s intent clear:
openssl crl2pkcs7 \
-nocrl \
-certfile chain.pem \
-outform DER \
-out chain.p7bStep 22: Verify the P7B does not contain a private key
Extract its contents:
openssl pkcs7 \
-inform DER \
-in chain.p7b \
-print_certs \
-out extracted.pemYou should find:
-----BEGIN CERTIFICATE-----but not:
-----BEGIN PRIVATE KEY-----or:
-----BEGIN RSA PRIVATE KEY-----or:
-----BEGIN EC PRIVATE KEY-----The crl2pkcs7 command creates a certificate/CRL PKCS#7 structure and does not take a private-key input.
This is one reason P7B files are commonly used for distributing certificate chains without exposing private keys.
Step 23: Compare PKCS#7 with PKCS#12
If a destination asks for:
.p7bdo not send:
.pfxwithout checking what it actually requires.
P7B / PKCS#7
Usually contains:
certificate
intermediate certificates
root certificates
possibly CRLsNo corresponding private key is packaged by crl2pkcs7.
PFX / P12 / PKCS#12
May contain:
private key
certificate
certificate chainFor PKCS#12 examples, see the MisterPKI PKCS12 guide.
This distinction is critical when exporting or transferring TLS credentials.
Step 24: Inspect the ASN.1 structure
A DER P7B is ASN.1.
Run:
openssl asn1parse \
-inform DER \
-in server-chain.p7b \
-iYou should see a PKCS#7/CMS-style structure containing certificates.
For low-level ASN.1 troubleshooting, see OpenSSL asn1parse.
Normally:
openssl pkcs7 -print_certsis much easier to use for certificate inventory.
Use asn1parse when you need to investigate encoding or structural problems.
Common openssl crl2pkcs7 errors
Unable to load certificates
Test the input:
openssl x509 \
-in certificate.pem \
-noout \
-subjectPossible causes include:
- file is DER rather than PEM;
- file contains a CSR;
- file contains a private key;
- PEM boundaries are damaged;
- file path is incorrect.
Remember that:
-certfileexpects PEM certificates.
Unable to load CRL
Check:
openssl crl \
-in ca.crl \
-noout \
-issuerIf the CRL is DER:
openssl crl \
-inform DER \
-in ca.crl \
-noout \
-issuerThen specify:
-inform DERto crl2pkcs7.
OpenSSL waits for input
If you intended to create a certificate-only bundle but forgot:
-nocrlOpenSSL may expect a CRL from standard input.
Cancel and rerun:
openssl crl2pkcs7 \
-nocrl \
-certfile chain.pem \
-outform DER \
-out chain.p7bThe P7B contains fewer certificates than expected
Inspect the source file:
grep -c \
'BEGIN CERTIFICATE' \
chain.pemThen inspect the P7B:
openssl pkcs7 \
-inform DER \
-in chain.p7b \
-print_certs \
-nooutMake sure every desired certificate was included using either:
-certfilemultiple times or a multi-certificate PEM file.
Unable to parse the P7B
You may have the wrong encoding.
Try PEM:
openssl pkcs7 \
-inform PEM \
-in chain.p7b \
-print_certs \
-nooutThen DER:
openssl pkcs7 \
-inform DER \
-in chain.p7b \
-print_certs \
-nooutDo not rely solely on:
.p7bto determine encoding.
Windows says the P7B is invalid
Create an explicit binary DER file:
openssl crl2pkcs7 \
-nocrl \
-certfile chain.pem \
-outform DER \
-out chain.p7bThen verify locally:
openssl pkcs7 \
-inform DER \
-in chain.p7b \
-print_certs \
-nooutIf OpenSSL can parse it correctly, investigate whether the destination expects:
- DER P7B;
- PEM PKCS#7;
- only CA certificates;
- leaf plus intermediates;
- another certificate format entirely.
The certificate chain is still invalid after import
PKCS#7 packaging does not repair an invalid certificate chain.
Verify the original chain:
openssl verify \
-CAfile root-ca.crt \
-untrusted intermediate-ca.crt \
server.crtExpected:
server.crt: OKIf that fails, troubleshoot the actual chain rather than recreating the P7B.
Important crl2pkcs7 options
| Option | Purpose |
|---|---|
-help | Displays command help |
-inform PEM | Treats the input CRL as PEM |
-inform DER | Treats the input CRL as DER |
-outform PEM | Writes PEM PKCS#7 output |
-outform DER | Writes binary DER PKCS#7 output |
-in file | Reads the optional CRL |
-out file | Writes the PKCS#7 structure |
-certfile file | Adds one or more PEM certificates |
-nocrl | Creates the structure without reading a CRL |
-provider | Loads an OpenSSL provider |
-provider-path | Specifies provider module location |
-provparam | Supplies provider parameters in newer OpenSSL versions |
-propquery | Applies a property query |
The full syntax is available in the official OpenSSL 3.5 crl2pkcs7 documentation.
Frequently asked questions
What does openssl crl2pkcs7 do?
It creates a PKCS#7 SignedData structure containing one or more certificates and optionally a CRL. The structure contains no signers.
Do I need a CRL to use crl2pkcs7?
No.
Use:
openssl crl2pkcs7 \
-nocrl \
...to create a certificate-only PKCS#7 bundle.
How do I convert PEM certificates to P7B?
Run:
openssl crl2pkcs7 \
-nocrl \
-certfile chain.pem \
-outform DER \
-out chain.p7bHow do I put several certificates into one P7B?
Use multiple -certfile options:
openssl crl2pkcs7 \
-nocrl \
-certfile server.crt \
-certfile intermediate.crt \
-certfile root.crt \
-outform DER \
-out chain.p7bOr place all certificates into one PEM file and specify that file once.
How do I view certificates inside a P7B?
Use:
openssl pkcs7 \
-inform DER \
-in chain.p7b \
-print_certs \
-nooutHow do I convert P7B to PEM?
Run:
openssl pkcs7 \
-inform DER \
-in chain.p7b \
-print_certs \
-out chain.pemDoes a P7B contain a private key?
The certificate-only PKCS#7 structure created with openssl crl2pkcs7 does not contain a private key. The command accepts certificates and an optional CRL, not a private key.
What is the difference between P7B and PFX?
P7B/PKCS#7 generally carries certificates and possibly CRLs.
PFX/PKCS#12 can carry certificates plus a corresponding private key.
Should I use PEM or DER output?
Use the format required by the destination.
For text-oriented processing:
PEMmay be easier.
For .p7b imports into many enterprise applications:
DERis commonly appropriate.
Always confirm the destination’s requirements.
Does the certificate order matter?
Keeping the logical order:
leaf
intermediate
rootmakes the bundle easier to inspect, but chain validation ultimately depends on certificate issuer/subject relationships and trust rather than filename order.
Can I include a CRL?
Yes.
Omit:
-nocrland supply the CRL with:
-inFor example:
openssl crl2pkcs7 \
-in ca.crl \
-certfile chain.pem \
-outform DER \
-out chain-with-crl.p7bDoes openssl crl2pkcs7 work with OpenSSL 4.0?
Yes.
The core command remains available with the same certificate and CRL packaging workflow. OpenSSL 3.5 and 4.0 additionally document the provider parameter option -provparam.
Practical P7B conversion workflow
Start with:
server.crt
intermediate-ca.crt
root-ca.crtVerify the certificates
openssl verify \
-CAfile root-ca.crt \
-untrusted intermediate-ca.crt \
server.crtExpected:
server.crt: OKCreate the P7B
openssl crl2pkcs7 \
-nocrl \
-certfile server.crt \
-certfile intermediate-ca.crt \
-certfile root-ca.crt \
-outform DER \
-out server-chain.p7bInspect the P7B
openssl pkcs7 \
-inform DER \
-in server-chain.p7b \
-print_certs \
-nooutExtract it back to PEM for validation
openssl pkcs7 \
-inform DER \
-in server-chain.p7b \
-print_certs \
-out extracted-chain.pemCount the certificates
grep -c \
'BEGIN CERTIFICATE' \
extracted-chain.pemExpected:
3You now have a DER-encoded:
server-chain.p7bcontaining the server certificate and its CA chain without including a private key.
Security and privacy considerations
PKCS#7 certificate bundles generally contain public certificate material rather than private keys.
That does not mean the content is always harmless to publish.
Certificates can expose:
- internal DNS names;
- organization names;
- email addresses;
- internal CA names;
- certificate serial numbers;
- private OIDs;
- internal PKI hierarchy information.
Before sharing:
openssl pkcs7 \
-print_certs \
-textoutput in:
- support tickets;
- GitHub;
- forums;
- documentation;
- screenshots;
review the content and replace internal values when appropriate.
Never accidentally package or publish unrelated private-key material from the same working directory.
Related OpenSSL guides
- Browse the complete OpenSSL Commands Guide.
- Learn how to inspect and extract PKCS#7 certificate bundles.
- Understand certificate chains before packaging them.
- Validate a chain with OpenSSL verify.
- Inspect low-level encoding with OpenSSL asn1parse.
- Compare P7B with PKCS#12/PFX certificate stores.
- Decode PKCS#7 bundles and CRLs with the MisterPKI SSL Tools.
External references
- OpenSSL 3.5 crl2pkcs7 documentation
- OpenSSL 3.0 crl2pkcs7 documentation
- OpenSSL 4.0 crl2pkcs7 documentation
- OpenSSL pkcs7 documentation
- OpenSSL crl documentation
- OpenSSL x509 documentation
- OpenSSL verify documentation
Conclusion
The openssl crl2pkcs7 command has a misleadingly specialized name.
You do not need a CRL to use it.
For system administrators, its most useful role is often:
PEM certificate files
↓
openssl crl2pkcs7
↓
PKCS#7 / P7B certificate bundleThe command worth remembering is:
openssl crl2pkcs7 \
-nocrl \
-certfile chain.pem \
-outform DER \
-out chain.p7bThen always inspect the result:
openssl pkcs7 \
-inform DER \
-in chain.p7b \
-print_certs \
-nooutFor a complete server chain, the practical workflow is:
Verify leaf + intermediate + root
↓
Create PKCS#7 bundle
↓
Inspect bundle
↓
Extract and confirm certificates
↓
Deliver P7B to destination systemIf a CRL is required, omit -nocrl and provide the CRL through -in.
Most importantly, remember that PKCS#7 packaging does not validate or repair a certificate chain. Verify the certificates first, then package the known-good chain into the format required by the destination system.
Leave a Reply