Add a note about ASN.1 structures edition

This commit is contained in:
William Robinet 2024-10-01 17:49:15 +02:00
parent e125ae7338
commit 35005fa23e
No known key found for this signature in database
GPG key ID: 003FA3DF74C7A949

View file

@ -195,6 +195,33 @@ openssl pkcs7 -print_certs -in certificatename.p7b -out certificatename.cer
openssl pkcs12 -export -in certificatename.cer -inkey privateKey.key -out certificatename.pfx -certfile cacert.cer openssl pkcs12 -export -in certificatename.cer -inkey privateKey.key -out certificatename.pfx -certfile cacert.cer
``` ```
* **ASN.1 (DER/PEM) editing** (works with certificates or almost any other ASN.1 structure):
1. Clone [asn1template](https://github.com/wllm-rbnt/asn1template/)
```bash
git clone https://github.com/wllm-rbnt/asn1template.git
```
2. Convert DER/PEM to OpenSSL's generation format
```bash
asn1template/asn1template.pl certificatename.der > certificatename.tpl
asn1template/asn1template.pl -p certificatename.pem > certificatename.tpl
```
3. Edit certificatename.tpl according to your requirements
```bash
vim certificatename.tpl
```
4. Rebuild the modified certificate
```bash
openssl asn1parse -genconf certificatename.tpl -out certificatename_new.der
openssl asn1parse -genconf certificatename.tpl -outform PEM -out certificatename_new.pem
```
*** ***
<figure><img src="../.gitbook/assets/image (48).png" alt=""><figcaption></figcaption></figure> <figure><img src="../.gitbook/assets/image (48).png" alt=""><figcaption></figcaption></figure>