openssl req -new -x509 -key命令用于生成自签名证书。这个命令结合了多个步骤,包括生成一个新的证书请求(CSR)并立即自签名生成证书,而不需要通过证书颁发机构(CA)进行签名。 2. -new、-x509、-key参数的具体作用 -new:此选项告诉OpenSSL生成一个新的证书请求(CSR)。 -x509:此选项指示OpenSSL使用CSR来生成一个...
由于x509无法建立证书请求文件,所以只能使用openssl req来生成请求文件,然后使用x509来自签署。自签署时, #使用"-req"选项明确表示输入文件为证书请求文件,否则将默认以为是证书文件,再使用"-signkey"提供自签署时使用的私钥。 openssl req -new -keyout key.pem -out req.csr openssl x509 -req -in req.csr -...
openssl x509 -in cert.cer -inform DER -outform PEM -out cert.pem # example2 使用根CA证书对"请求签发证书"进行签发,生成x509格式证书 openssl x509 -req -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -extensions v3_req # example3 打印出证书的内容 ope...
Enter pass phrasefortypecodes.key: Verifying - Enter pass phrasefortypecodes.key: [输入两次相同的密码] ### 2 生成CSR证书签名请求文件typecodes.csr [root@typecodes ssl]# openssl req -new-key typecodes.key -outtypecodes.csr Enter pass phrasefortypecodes.key: [输入之前的密码] You are about ...
#上面的命令加上-new选项是同样的执行效果 openssl req -new -x509 -newkey rsa:1024 -out client.crt -keyout client.key -batch -nodes 2. #生成自签名证书,证书名client.crt,指定秘钥文件,秘钥文件为rsa_private_key.pem。 openssl req -new -x509 -key ./rsa_private_key.pem -out client.crt -no...
第一步:生成私钥文件.key genrsa -out test.key 2048 2048:表示私钥文件字节大小 第二步:生成cer格式证书(适用windows系统) req -new -x509 -key test.key -out test.cer -days 3650 -509:表示生成x509证书而不是生成证书请求文件csr -key:指定私钥文件,与生成的cer(实际就是包含公钥)形成密钥对 ...
openssl req-newkeyrsa:2048-x509 -days5480-keyoutCA2048.key-outCA2048.crt 2.2 为顶级CA的私钥文件去除加密保护 上节提到,顶级CA的私钥文件是经过加密保护的,以后每当需读取 CA.key 文件中的私钥信息时,都需输入解密口令。这种做法适合有安全需求的场合,但如果觉得不方便,也可以去除这个口令。
:: 根CA签发:: 删除之前所有的文件d:&cd\&rd/s/q host1&rd/s/q host2&rd/s/q rca&md host1&md host2&md rca&cd rca :: 生成自签名的根证书,私钥和公钥:openssl req -x509 -newkey rsa:8192 -keyout rca.key -out rca.cer -days 3650 -subj /C=CN/ST=jiangsu/L=nanjing/O=Tiger/OU=...
openssl req -newkey rsa:2048 -nodes -keyout rsa_private.key -x509 -days 365 -out cert.crt req是证书请求的子命令,-newkey rsa:2048 -keyout private_key.pem 表示生成私钥(PKCS8格式),-nodes 表示私钥不加密,若不带参数将提示输入密码; -x509表示输出证书,-days365 为有效期,此后根据提示输入证书拥...
#上面的命令加上-new选项是同样的执行效果 openssl req -new -x509 -newkey rsa:1024 -out client.crt -keyout client.key -batch -nodes 2. #生成自签名证书,证书名client.crt,指定秘钥文件,秘钥文件为rsa_private_key.pem。 openssl req -new -x509 -key ./rsa_private_key.pem -out client.crt -no...