openssl - CFSSL 配置与 OpenSSL 配置
问题描述
有谁知道您可以在 OpenSSL 配置文件中指定的所有字段是否在 Cloudflare 的 CFSSL 证书颁发机构工具包中可用?default_md
CFSSL 在其 JSON 配置文件(以下是其中的摘录)中识别的选项中似乎缺少某些字段(例如或指定国家必须匹配):
type CAConstraint struct {
IsCA bool `json:"is_ca"`
MaxPathLen int `json:"max_path_len"`
MaxPathLenZero bool `json:"max_path_len_zero"`
}
// A SigningProfile stores information that the CA needs to store
// signature policy.
type SigningProfile struct {
Usage []string `json:"usages"`
IssuerURL []string `json:"issuer_urls"`
OCSP string `json:"ocsp_url"`
CRL string `json:"crl_url"`
CAConstraint CAConstraint `json:"ca_constraint"`
OCSPNoCheck bool `json:"ocsp_no_check"`
ExpiryString string `json:"expiry"`
BackdateString string `json:"backdate"`
AuthKeyName string `json:"auth_key"`
RemoteName string `json:"remote"`
NotBefore time.Time `json:"not_before"`
NotAfter time.Time `json:"not_after"`
NameWhitelistString string `json:"name_whitelist"`
AuthRemote AuthRemote `json:"auth_remote"`
CTLogServers []string `json:"ct_log_servers"`
AllowedExtensions []OID `json:"allowed_extensions"`
CertStore string `json:"cert_store"`
Policies []CertificatePolicy
Expiry time.Duration
Backdate time.Duration
Provider auth.Provider
RemoteProvider auth.Provider
RemoteServer string
RemoteCAs *x509.CertPool
ClientCert *tls.Certificate
CSRWhitelist *CSRWhitelist
NameWhitelist *regexp.Regexp
ExtensionWhitelist map[string]bool
ClientProvidesSerialNumbers bool
}
CFSSL 是否抽象了许多 OpenSSL 配置选项,或者我只是没有看到您可以在哪里指定它们?
解决方案
消息摘要算法似乎是动态选择的,并且取决于 CA 私钥的长度。
func DefaultSigAlgo(priv crypto.Signer) x509.SignatureAlgorithm {
pub := priv.Public()
switch pub := pub.(type) {
case *rsa.PublicKey:
keySize := pub.N.BitLen()
switch {
case keySize >= 4096:
return x509.SHA512WithRSA
case keySize >= 3072:
return x509.SHA384WithRSA
case keySize >= 2048:
return x509.SHA256WithRSA
default:
return x509.SHA1WithRSA
} ...
基于我在 Github 上的 CFSSL 源代码中找到的内容。
关于县,我无法在代码中找到任何限制或配置它的限制,可以假设所有国家都被允许。
推荐阅读
- laravel - Laravel 语法错误,意外的“路线”
- c# - Superpower:仅当字符串开始一行时才将字符串与解析器匹配
- android - SQLite:没有这样的表错误Android P问题
- php - 在 Woocommerce 中使用 wc_get_products 查询所有没有 API 的产品
- c++ - 使用链表实现河内塔的异常错误
- html - 下一页的标题出现在同一背景图像下
- windows - heroku pg:psql --app error CLI FATAL: no pg_hba.conf entry for host "hostIp", user "user name", database "Name", SSL off
- java - 无法使用 Volley 获取 MySQL 数据库中的所有行
- json - 如何在密码中创建具有可变标签的节点?
- mysql - 如何通过比较 SQL 查询中的两个项目名称及其日期来选择数据