AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-1005698

JeanMarc's questions

Martin Hope
JeanMarc
Asked: 2024-03-13 14:29:05 +0800 CST

OpenSSL CSR 在自定义属性值中添加前缀

  • 6

我正在创建一个 OpenSSL 配置,该配置应有助于生成 Hyperledger Fabric Identity 和 TLS 证书的证书签名请求(我们不能在我们的组织中使用 Fabric CA)。我当前的配置生成如下 CSR:

openssl req -in ecdsa_ident_req.pem -text -noout
Certificate Request:
    Data:
        Version: 1 (0x0)
        Subject: C=NL, L=RD, OU=ll, CN=33
        Subject Public Key Info:
            Public Key Algorithm: id-ecPublicKey
                Public-Key: (256 bit)
                pub:
                    04:d2:5b:38:77:b4:8e:1d:97:ab:fa:82:8a:5b:5e:
                    8f:d5:f4:8f:5a:7e:fb:0b:c1:1e:15:31:cf:e6:47:
                    9c:91:ce:5d:2b:9d:6b:7c:91:a9:ba:35:3f:7c:5c:
                    d9:a4:5d:d9:51:6e:65:73:a0:b3:c9:79:af:85:90:
                    a6:19:4e:76:f5
                ASN1 OID: prime256v1
                NIST CURVE: P-256
        Attributes:
            Requested Extensions:
                X509v3 Basic Constraints: critical
                    CA:FALSE
                X509v3 Key Usage:
                    Digital Signature, Non Repudiation
                1.2.3.4.5.6.7.8.1:
                    .l{"attrs":{"abac.init":"true","admin":"true","hf.Affiliation":"","hf.EnrollmentID":"Admin","hf.Type":"user"}}
    Signature Algorithm: ecdsa-with-SHA256
    Signature Value:
...

令人意想不到的是.l属性值中的前缀1.2.3.4.5.6.7.8.1。

我需要在设置中进行哪些更改才能将值设置为不带该.l前缀的 JSON 字符串。

我使用的是openssl版本

OpenSSL 3.2.1 30 Jan 2024 (Library: OpenSSL 3.2.1 30 Jan 2024)

我使用生成的 CSR

export ISHARE_ATTRS="{\"attrs\":{\"abac.init\":\"true\",\"admin\":\"true\",\"hf.Affiliation\":\"\",\"hf.EnrollmentID\":\"Admin\",\"hf.Type\":\"user\"}}"
openssl req -config ./openssl.cnf -new -newkey ec:ec_param.pem -section req_ecdsa_identity_admin -keyout ecdsa_ident_key.pem -out ecdsa_ident_req.pem

其内容opensll.cnf是:

# Barebones openssl configuration that can be used to generate CSRs for
# - iSHARE Satellite Identity/Enrollment certificates
# - iSHARE Satellite TLS certificates

# Resources/documentation
# - https://www.openssl.org/docs/man3.0/man5/config.html

openssl_conf = openssl_init

[ openssl_init ]
alg_section = evp_properties
engines = engines
oid_section = OID
providers = providers
random = random
ssl_conf = ssl_configuration

[ engines ]

[ evp_properties ]

[ OID ]
iShareAttributesExtension = 1.2.3.4.5.6.7.8.1

[ providers ]

[ random ]

[ ssl_configuration ]
server = tls_server_config
client = tls_client_config
system_default = tls_system_default

[ tls_client_config ]
# configuration for SSL/TLS clients
RSA.Certificate = client-rsa.pem
ECDSA.Certificate = client-ecdsa.pem

[ tls_server_config ]
# configuration for SSL/TLS servers
RSA.Certificate = server-rsa.pem
ECDSA.Certificate = server-ecdsa.pem

[ tls_system_default ]
MinProtocol = TLSv1.2
MinProtocol = DTLSv1.2

[ req_dn_identity ]
countryName              = Country Name (2 letter code)
countryName_default      = NL
countryName_min          = 2
countryName_max          = 2
localityName             = Locality Name (eg, city)
organizationalUnitName   = Organizational Unit Name (eg, section)
commonName               = Common Name (eg, YOUR name)
commonName_max           = 64

[ req_dn_tls ]
countryName              = Country Name (2 letter code)
countryName_default      = NL
countryName_min          = 2
countryName_max          = 2
localityName             = Locality Name (eg, city)
organizationalUnitName   = Organizational Unit Name (eg, section)
commonName               = Common Name (eg, hostname)
commonName_max           = 64

[ req_ecdsa_identity_admin ]
distinguished_name = req_dn_identity
req_extensions = x509v3_identity

[ req_ecdsa_identity_user ]
distinguished_name = req_dn_identity
req_extensions = x509v3_identity

[ req_ecdsa_identity_peer ]
distinguished_name = req_dn_identity
req_extensions = x509v3_identity

[ req_ecdsa_identity_orderer ]
distinguished_name = req_dn_identity
req_extensions = x509v3_identity

[ req_ecdsa_tls ]
distinguished_name = req_dn_tls
req_extensions = x509v3_ecdsa_tls

[ req_rsa_tls ]
distinguished_name = req_dn_tls
default_bits = 4096
req_extensions = x509v3_rsa_tls

[ x509v3_identity ]
basicConstraints = critical, CA:FALSE
keyUsage = digitalSignature,nonRepudiation
iShareAttributesExtension = ASN1:UTF8String:$ENV::ISHARE_ATTRS

[ x509v3_ecdsa_tls ]
basicConstraints = critical, CA:FALSE
keyUsage = keyEncipherment, dataEncipherment, keyAgreement
extendedKeyUsage = clientAuth, serverAuth

[ x509v3_rsa_tls ]
basicConstraints = critical, CA:FALSE
keyUsage = keyEncipherment, dataEncipherment, keyAgreement
extendedKeyUsage = clientAuth, serverAuth

openssl
  • 1 个回答
  • 18 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Vickel Firefox 不再允许粘贴到 WhatsApp 网页中? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve