openssl3.2/test/certs – 022 – CA has 768-bit key

文章目录

    • openssl3.2/test/certs - 022 - CA has 768-bit key
    • 概述
    • 笔记
    • END

openssl3.2/test/certs - 022 - CA has 768-bit key

概述

openssl3.2 - 官方demo学习 - test - certs

笔记

// file my_openssl_linux_log_doc_022.txt
//
ote openssl3.2/test/certs - 022 - CA has 768-bit key

// --------------------------------------------------------------------------------
// 官方脚本
// --------------------------------------------------------------------------------
// root-cert.pem, root-key.pem from exp 001

// openssl3.2/test/certs - 022 - CA has 768-bit key
OPENSSL_KEYBITS=768 ./mkcert.sh genca “CA” ca-key-768 ca-cert-768 root-key root-cert

// --------------------------------------------------------------------------------
// openssl cmd line parse
// --------------------------------------------------------------------------------
// cmd1:
openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:768 -out ca-key-768.pem

// cmd2:
// config file = cfg_exp022_cmd2.txt
string_mask=utf8only
[req]
prompt = no
distinguished_name = dn
[dn]
CN = CA

openssl req -new -sha256 -key ca-key-768.pem -config cfg_exp022_cmd2.txt -out ca-key-768-req.pem

// cmd3:
// config file = extfile_exp022_cmd3.txt
basicConstraints = critical,CA:true
keyUsage = keyCertSign,cRLSign
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid

openssl x509 -req -sha256 -out ca-cert-768.pem -extfile extfile_exp022_cmd3.txt -CA root-cert.pem -CAkey root-key.pem -set_serial 2 -days 36525 -in ca-key-768-req.pem

// --------------------------------------------------------------------------------
// openssl log
// --------------------------------------------------------------------------------
openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:768 -out ca-key-768.pem
openssl req -new -sha256 -key ca-key-768.pem -config /dev/fd/63

-config /dev/fd/63 => /home/lostspeed/openssl/openssl-3.2.0_debian/test/certs/my_openssl_linux_log.txt

string_mask=utf8only
[req]
prompt = no
distinguished_name = dn
[dn]
CN = CA
openssl x509 -req -sha256 -out ca-cert-768.pem -extfile /dev/fd/63 -CA root-cert.pem -CAkey root-key.pem -set_serial 2 -days 36525

-extfile /dev/fd/63 => /home/lostspeed/openssl/openssl-3.2.0_debian/test/certs/my_openssl_linux_log.txt

basicConstraints = critical,CA:true
keyUsage = keyCertSign,cRLSign
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid

END