首页 > 解决方案 > 使用 Pem 文件获取公钥/私钥

问题描述

我的证书是 Contains Private Key,Root Chain和 Format 是Base64(openSSL)
我的证书内容。(mycert.pem):

subject=CN=MainDomain.com, OU=ISD, O=GIT Inc, S=AR, C=US
issuer=CN=ABC, DC=homeoffice, DC=ABC, DC=com
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
subject=CN=-TLS-01-SHA256, DC=homeoffice, DC=ABC, DC=com
issuer=CN=ABC01-SHA256, DC=homeoffice, DC=ABC, DC=com
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
subject=CN=-TLSRoot-01-SHA256, DC=homeoffice, DC=ABC, DC=com
issuer=CN=ABC01-SHA256, DC=homeoffice, DC=ABC, DC=com
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
subject=CN=-TLSSOME-01-SHA256, DC=homeoffice, DC=ABC, DC=com
issuer=CN=ABC01-SHA256, DC=homeoffice, DC=ABC, DC=com
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
-----END RSA PRIVATE KEY-----

我需要在 GCP 负载均衡器端提供这些东西

Public key certificate (.crt file)
Certificate chain (.csr file)
Private key (.key file).

我怎样才能生成这些东西?我可以直接复制粘贴内容吗?它与我的pem文件中提供的内容相同吗

标签: google-cloud-platformopensslssl-certificategoogle-cloud-http-load-balancer

解决方案


Yes, you can simply copy/paste your certificate content or upload it, as it's described here:

  1. Go to the Network Services> Load Balancing> Certificates tab in the Google Cloud Console.
  2. Click Create SSL certificate.
  3. Enter a name and an optional description for the certificate.
  4. Select Upload my certificate.
  5. Paste in your certificate or click Upload to navigate to your certificate file. You can choose to include the CA certificate chain in the same file as the certificate. Google Cloud does not validate the certificate chain for you – validation is your responsibility.
  6. Paste in your private key or click Upload to navigate to your private key file.
  7. Click Create.

here

If you have any other question about how to Use self-managed SSL certificates, here is the Google public documentation link:

https://cloud.google.com/load-balancing/docs/ssl-certificates/self-managed-certs#createresoure


推荐阅读