openssl命令

openssl dgst -verify pub.pem -sha256 -signature sign.txt file.txt  经过公钥pub.pem验证签名文件sign.txt和file.txtnode

openssl x509 -in new.crt -pubkey -noout > pubkey.pem 从证书new.crt提取公钥文件pubkey.pemlinux

openssl base64 -in test.base64 -d -out text.bin 将base64编码文件test.base64转为二进制文件tetx.bin  须要手动在test.base64后添加换行符编码

openssl dgst -binary -sha256 -out hash.bin test.tar   计算test.tar包的hash值 (二进制格式)
openssl base64 -in hash.bin -out hash.base64 计算base64编码.net

对csr文件进行签名:orm

openssl smime -sign -binary -signer certificat.pem -inkey key.pem -in testCSRfile_to_sign.pem -out testCSRfile_smime.signed -nodetachserver

openssl smime -verify -noverify -in testCSRfile_smime.signed -pk7out -out testCSRfile_P7.signedssl

openssl pkcs7 -in testCSRfile_P7.signed -out testCSRfile_P7_DER.signed -outform deropenssl

mv testCSRfile_P7_DER.signed PKCS10_testCSRfile.datahash

openssl经常使用命令base64

http://man.linuxde.net/openssl

 

ECC证书请求文件

openssl ecparam -name prime256v1 -genkey -out server-ecc.key 生成密钥
openssl req -new -key server-ecc.key -out server.csr 生成csr请求文件

从p7b格式证书链提取证书

openssl pkcs7 -inform der -in consol_p7_MP_ECC_256_18.p7b -out MP_ECC.p7b

openssl pkcs7 -print_certs -in MP_ECC.p7b -out MP_ECC.cer

 

验证证书链

 openssl verify -CAfile MP_RSA_2048_chain.cer -untrusted rsa_sec.cer submp.cer

MP_RSA_2048_chain二级证书链,有根证书和二级证书

rsa_sec.cer二级证书

submp.cer叶子证书

相关文章
相关标签/搜索