原文:
http://www.iona.com/support/docs/orbix2000/2.0/tls/html/OpenSslUtils3.html
许
多OpenSSL命令(例如,req和ca)带有一个-config参数用于指定openssl配置文件的位置.
本节提供配置文件格式的简短描述
和它怎么应用于req和ca命令.本节结尾列出了一个配置文件的例子.
openssl.cnf配置文件由许多节(section)组成,
这些节指定了一系列由openssl命令使用的默认值.
[req] 变量
req节包含下列设置:
default_bits=1024
default_keyfile=privkey.pem
distinguished_name=req_distingguished_name
# section name
attributes=req_attributes # section
name
default_bits : 是你希望使用的RSA
key的默认长度,其它的可能值是512,2048和4096
default_keyfile : 由req建立的私钥文件的默认文件名.
distinguished_name
: 也是配置文件中的节,这个节为distinguished name域各组件定义默认值.req_attributes
变量指定配置文件中
定义证书请求属性的默认值的节.
[ca] 变量
你可以配置openssl.cnf来支持许多为签名CSR文件而有着不同策略
(policy)的CA.
-name参数来指定要使用哪个CA节.例如:
openssl ca -name MyCa ...
这
个命令引用CA的节[MyCa], 如果-name没被提供给ca命令,那就使用default_ca变量指定的节.
可以有多个不同的CA,但只
能有一个是默认的CA。
可能的[ca]变量包含如下内容:
dir: CA数据库的位置.
数据库是指一个简单的文本数据库,里面包含由tab分隔的字段:
status : 'R' - revoked(撤销的),
'E' - expired(过期的), 'V' - 有效
issued date : 发证日期
revoked
date : 撤销日期,如果没被撤销,空
serial number : 序号
certificate :
证书存放位置
CN : 证书的文件名
serial字段应当是唯当像CN/status组合一样是唯一的,ca程序在启动时检测这些值.
certs:
所有以前发布的证书保存的地方.
[policy] 变量
如果ca命令的-policy参数没被提供,policy变量指定默认的
policy节.
CA策略节表示在证书在被CA签发前,证书请求的内容必须被满足的必要条件.
例子定义了两个policy:
policy_match和policy_anything.
看一下如下值:
countryName=match
这意味
着country name必须匹配CA证书。
organisationalUnitName=optional
这表示
organistationalUnitName是可选的.
commonName=supplied
这表示commonName
在证书请求中必须提供
例子openssl.cnf文件的policy_match节指定了在生成的证书中属性的顺序,如下:
countryName
stateOrProvinceName
organizationName
organizationalUnitName
commonName
emailAddress
Example
openssl.cnf File
################################################################
# openssl example configuration file.
# This is mostly used for
generation of certificate requests.
#################################################################
[ ca ]
default_ca= CA_default # The default ca section
#################################################################
[ CA_default ]
dir=/opt/iona/OrbixSSL1.0c/certs # Where everything is kept
certs=$dir # Where the issued certs are kept
crl_dir= $dir/crl # Where the issued crl are kept
database= $dir/index.txt # database index file
new_certs_dir= $dir/new_certs # default place for new certs
certificate=$dir/CA/OrbixCA # The CA certificate
serial=
$dir/serial # The current serial number
crl=
$dir/crl.pem # The current CRL
private_key=
$dir/CA/OrbixCA.pk # The private key
RANDFILE=
$dir/.rand # private random number file
default_days= 365 # how long to certify for
default_crl_days= 30 # how long before next CRL
default_md= md5 # which message digest to use
preserve= no # keep passed DN ordering
# A few different ways of specifying how closely the request should
# conform to the details of the CA
policy=
policy_match # For the CA policy
[
policy_match ]
countryName= match
stateOrProvinceName=
match
organizationName= match
organizationalUnitName=
optional
commonName= supplied
emailAddress= optional
# For the `anything' policy
# At this point in time,
you must list all acceptable `object'
# types
[
policy_anything ]
countryName = optional
stateOrProvinceName= optional
localityName= optional
organizationName = optional
organizationalUnitName = optional
commonName= supplied
emailAddress= optional
[
req ]
default_bits = 1024
default_keyfile= privkey.pem
distinguished_name = req_distinguished_name
attributes =
req_attributes
[ req_distinguished_name ]
countryName= Country Name (2 letter code)
countryName_min= 2
countryName_max = 2
stateOrProvinceName= State or Province Name
(full name)
localityName = Locality Name (eg, city)
organizationName = Organization Name (eg, company)
organizationalUnitName = Organizational Unit Name (eg, section)
commonName = Common Name (eg. YOUR name)
commonName_max = 64
emailAddress = Email Address
emailAddress_max = 40
[ req_attributes ]
challengePassword = A challenge password
challengePassword_min = 4
challengePassword_max = 20
unstructuredName= An optional company name
分享到:
相关推荐
在linux下安装Qt后一般没有QSsocket这个类,是因为没有配置openssl。所以在安装linux下的Qt时,要首先安装openssl,再配置安装就好了。文件直接解压在linux下安装就可以了。
openssl 的 cnf. 如果openssl 配置出现错误这是必备的
Windows平台OpenSSl_64位安装包,需配环境变量,可用于android系统签名文件生成JKS文件。...如果提示无法打开openssl配置文件:设置一下配置文件:set OPENSSL_CONF=C:\OpenSSL-Win64\bin\openssl.cfg
不错 这个是一个公司的网页需要加密 同时也说了手机上安装证书的步骤和相关对的格式
OpenSSL安装包_配置文件
基于ffmpeg4.0,lite配置文件的基础上开启openssl(以支持https)和AC3音频支持,编译得到的so文件。如需default编译的so文件,可从这里下载:https://download.csdn.net/download/SpbDev/20625321
37 7.4.1 mem bio 37 7.4.2 file bio 37 7.4.3 socket bio 38 7.4.4 md BIO 40 7.4.5 cipher BIO 40 7.4.6 ssl BIO 41 7.4.7 其他示例 43 第八章 Openssl配置文件 44 8.1 概述 44 8.2...
8.2 openssl配置文件读取 43 8.3 主要函数 44 8.4 编程示例 44 第九章 随机数 46 9.1 随机数 46 9.2 openssl随机数数据结构与源码 46 9.3 主要函数 48 9.4 编程示例 48 第十章 文本数据库 50 10.1 概述 50 10.2 数据...
用于在linux下给ndk编译openssl的配置文件,目标abi为arm64-v8a,基于官方的setenv修改
配置好openssl的resin4配置文件及loaclhost的证书(供测试用)
37 7.4.1 mem bio 37 7.4.2 file bio 37 7.4.3 socket bio 38 7.4.4 md BIO 40 7.4.5 cipher BIO 40 7.4.6 ssl BIO 41 7.4.7 其他示例 43 第八章 Openssl配置文件 44 8.1 概述 44 8.2...
第二章 openssl 简介................................................................................................................15 2.1 openssl 简介.....................................................
OpenSSL证书创建工具,用于证书创建、自签名等。 仅提取了openssl.exe、必须的2个DLL以及配置文件,直接解压后即可使用。 可参考我的博客《使用OpenSSL创建自签名证书》查看使用方法。
开源项目ijkplayer v0.8.8的源码编译出的so文件,用于Android开发,ffmpeg4.0+openssl,支持https,采用module-default.sh配置文件编译的。
在openssl1.0.1f中使用arm-hisiv300-linux- 交叉编译 出开源库的配置文件 ,具体修改参考我的博客。
第二章 openssl 简介................................................................................................................15 2.1 openssl 简介.....................................................
完整vs项目,包含项目完整配置文件,下载,即可编译出lib openssl.exe等 非网上命令行 nmake编译 一个解决方案,4个分项目 4各项目 各个项目下有具体说明 libcrypto项目 生成libcrypto.lib 第一个编译 libssl项目 ...