gpt4 book ai didi

java - 如何将 p7s 证书链导入 keystore ?

转载 作者:行者123 更新时间:2023-11-29 04:49:54 26 4
gpt4 key购买 nike

我已经使用这些命令来创建我的 csr

keytool -genkey -alias server -keyalg RSA -keysize 2048 -keystore domain.jks -dname "CN=*.domain.com,OU=Software Development, O=Company Name, L=Asuncion, ST=Central, C=PY"
keytool -certreq -alias server -keyalg RSA -sigalg SHA256withRSA -file domain.csr -keystore domain.jks

然后我已经签署了我的证书

Web Server CERTIFICATE
-----------------
-----BEGIN CERTIFICATE-----
MIIFZjCCBE6gAwIBAgIQeg8KZmYMVuy/9w/yfpEWozANBgkqhkiG9w0BAQsFADBC
MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMS
UmFwaWRTU0wgU0hBMjU2IENBMB4XDTE2MDMwNzAwMDAwMFoXDTE3MDQwNjIzNTk1
OVowFjEUMBIGA1UEAwwLKi5zZWdweS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQCk2tfnkEN7n6Qtg7wt4lbFHyBN0UW19aSjwme5/zXbLp5S0TUN
MSwxilEGFumUE700oAyT0uQBakV9m/qwrljDdZNgrR2+4VSJfMTL+fRSNQh//pls
TFV8sc6czPxnSKeT8ufsCFF50aadRnK2+GdLC5Vpfhlwfknpu7d3RI5aMFwWzSfG
YNsqShm7sJtYnwA1y3o9eG2XiDuNt6Y5+5lHEafwGxwg8gaL5MpY5wNPDNfr6sYp
YOkJi/JdgRlLnEZn2nTawJRhkODb64vZ5arteN06fBMJjw+yrhfFqt/MEwy2Odiv
WOrWgi1ODft3QHO8jd2JCX4j/apBTEm/acmtAgMBAAGjggKCMIICfjAhBgNVHREE
GjAYggsqLnNlZ3B5LmNvbYIJc2VncHkuY29tMAkGA1UdEwQCMAAwKwYDVR0fBCQw
IjAgoB6gHIYaaHR0cDovL2dwLnN5bWNiLmNvbS9ncC5jcmwwbwYDVR0gBGgwZjBk
Bg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QVNdnARqN7csiRv8lVK83Qlz6c
JmTM386DGXHKTubU1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmR
Cw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5asz
PeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo4HwMIHtMB8GA1UdIwQYMBaAFEjm
aPkr0rKV10fYIyAQTzOYkJ/UMB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrM
TjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjA6BgNVHR8EMzAxMC+g
LaArhilodHRwOi8vY3JsLmdlb3RydXN0LmNvbS9jcmxzL3NlY3VyZWNhLmNybDBO
BgNVHSAERzBFMEMGBFUdIAAwOzA5BggrBgEFBQcCARYtaHR0cHM6Ly93d3cuZ2Vv
dHJ1c3QuY29tL3Jlc291cmNlcy9yZXBvc2l0b3J5MA0GCSqGSIb3DQEBBQUAA4GB
AHbhEm5OSxYShjAGsoEIz/AIx8dxfmbuwu3UOx//8PDITtZDOLC5MH0Y0FWDomrL
NhGc6Ehmo21/uBPUR/6LWlxz/K7ZGzIZOKuXNBSqltLroxwUCEm2u+WR74M26x1W
b8ravHNjkOR/ez4iyz0H7V84dJzjA1BOoa+Y7mHyhD8S
-----END CERTIFICATE-----

我还收到了一个 p7s 文件 (domain.com.p7s)

我尝试了很多不同的方法来将它正确地导入到 keystore 中,但我得到了此页面中显示的错误 https://thedomain.com/ > ERR_CERT_AUTHORITY_INVALID

导入这条链的命令是什么?这不是我第一次这样做,但这次我就是无法让它发挥作用。

最佳答案

您必须使用用于生成 key 对和 CSR 的相同别名导入签名证书链,并且不使用 -trustcacerts 选项。

基本上是这样的

keytool -import -alias server -file domain.p7s -keystore domain.jks

关于java - 如何将 p7s 证书链导入 keystore ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35856239/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com