使用 Google Cloud 控制台签发证书
本快速入门指南介绍了如何使用 Google Cloud 控制台通过 Certificate Authority Service 生成或颁发证书。
了解如何在不预配或维护基础架构的情况下安全地管理私有证书授权机构 (CA)。
准备工作
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
如果您要使用现有项目来完成本指南,请验证您是否拥有完成本指南所需的权限。如果您创建了新项目,则您已拥有所需的权限。
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Certificate Authority Service API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles. -
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
如果您要使用现有项目来完成本指南,请验证您是否拥有完成本指南所需的权限。如果您创建了新项目,则您已拥有所需的权限。
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Certificate Authority Service API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles. -
CA Service Operation Manager (
roles/privateca.caManager) -
CA Service Certificate Manager (
roles/privateca.certificateManager) 前往 Google Cloud 控制台中的 Certificate Authority Service 页面。
在 CA 池管理器标签页下,点击 创建池。
在创建 CA 池页面上,为 CA 池添加名称。
点击区域,然后选择 us-east1(南卡罗来纳)作为 CA 池的区域。
在每个步骤中,点击下一步。
点击完成。
- 在 Certificate Authority Service 页面上,点击 CA 管理器。
- 点击创建 CA 展开箭头,然后选择在现有 CA 池中创建 CA。
- 选择您创建的 CA 池。
- 点击继续。
- 在选择 CA 类型 部分,点击继续。
- 在组织 (O) 字段中,输入您组织的名称。
- 在 CA 通用名称 (CN) 字段中,输入 CA 的名称。请记下 CA 名称,因为您在申请证书时需要用到该名称。
- 点击每个步骤中的继续。
- 查看 CA 的详细信息,然后点击完成。
- 在 Certificate Authority Service 页面上,点击 CA 池管理器。
- 点击 Create pool(创建池)。
在创建 CA 池 页面上,为从属 CA 池添加名称。
点击区域,然后选择 us-east1(南卡罗来纳)作为下级 CA 池的区域。
在每个步骤中,点击下一步。
点击完成。
- 在 Certificate Authority Service 页面上,点击 CA 管理器。
- 点击创建 CA 展开箭头,然后选择在现有 CA 池中创建 CA。
- 选择您创建的从属 CA 池。
- 点击继续。
- 点击从属 CA。
- 点击 Root CA is in Google Cloud。
- 在签名证书授权机构字段中,点击浏览。
- 在选择 CA 对话框中,选择在创建根 CA 部分中创建的根 CA。
- 点击确认。
- 在有效期字段中,输入您希望下级 CA 证书的有效期。
- 点击继续。
- 在组织 (O) 字段中,输入您组织的名称。
- 在 CA 通用名称 (CN) 字段中,输入下级 CA 的名称。 请记下从属 CA 名称,因为您需要使用它来请求证书。
- 点击每个步骤中的继续。
- 查看下级 CA 的详细信息,然后点击完成。
- 在证书授权机构页面上,点击申请证书。
点击输入详细信息。
在添加域名下,输入您要使用此证书保护的网站的完全限定域名。
点击下一步。
在配置密钥大小和算法下,点击继续。
您会看到生成的证书,您可以复制或下载该证书。如需复制证书,请点击 。
点击完成。
撤消证书。
- 点击专用证书管理器标签页。
- 在证书列表中,点击要删除的证书所在行中的 查看更多。
- 点击撤消。
- 在随即打开的对话框中,点击确认。
删除 CA。
您只能在撤消 CA 颁发的所有证书后才能删除该 CA。
撤消证书后,请执行以下操作:
- 在 CA 列表中,选择要删除的 CA。
- 点击 删除。系统会显示删除证书授权机构对话框。
-
可选:如果符合以下条件,请选中一个或两个复选框:
-
删除此 CA(即使存在有效证书)
此选项可让您删除具有有效证书的 CA。删除具有有效证书的 CA 可能会导致依赖这些证书的网站、应用或系统出现故障。我们建议您先撤消 CA 颁发的所有有效证书,然后再删除该 CA。
-
跳过 30 天的宽限期,立即删除此 CA
30 天的宽限期让您有时间撤消此 CA 颁发的所有证书,并验证是否没有系统依赖于此 CA。我们建议仅在非生产或测试环境中使用此选项,以防止可能出现的中断和数据丢失。
-
- 点击确认。
CA 状态更改为
Deleted。CA 会在您发起删除操作 30 天后永久删除。删除 CA 池。
只有在 CA Service 永久删除 CA 后,您才能删除 CA 池。
删除 CA 池中的 CA 后,请执行以下操作:
- 点击 CA 池管理器标签页。
- 在 CA 池列表中,选择要删除的 CA 池。
- 点击 删除。
- 在随即打开的对话框中,点击确认。
如需删除项目,请执行以下操作:
- In the Google Cloud console, go to the Manage resources page.
- In the project list, select the project that you want to delete, and then click Delete.
- In the dialog, type the project ID, and then click Shut down to delete the project.
- 详细了解 CA 池。
- 详细了解如何创建 CA 池。
- 详细了解如何创建 CA。
- 详细了解如何申请证书。
- 了解如何控制 CA 池可颁发的证书类型。
所需的角色
如需获得完成本快速入门所需的权限,请让您的管理员为您授予项目的以下 IAM 角色:
如需详细了解如何授予角色,请参阅管理对项目、文件夹和组织的访问权限。
创建 CA 池
CA 池是包含多个 CA 的集合。CA 池能够轮替信任链,而不会中断或停止工作负载。CA 池位于单个Google Cloud 位置,创建后便无法更改。
如需使用默认设置创建 CA 池,请执行以下操作:
您可以在 CA 池管理器标签页下的 CA 池列表中看到此 CA 池。
创建根 CA
CA 池在创建时为空。您必须向 CA 池添加 CA 才能请求证书。
根 CA 具有位于客户端的受信任证书存储区中的自签名证书。本部分介绍了如何向您创建的 CA 池添加根 CA。
如需向 CA 池添加根 CA,请执行以下操作:
可选:创建从属 CA 池
借助从属 CA 池,您可以组织和管理多个从属 CA。根 CA 会验证并签署从属 CA 池中的所有 CA。
如需使用默认设置创建从属 CA 池,请执行以下操作:
确保从属 CA 池在 CA 池管理器标签页下的 CA 池列表中可用。
可选:创建由根 CA 签名的从属 CA
下级 CA 负责向需要证书的实体(例如 Web 服务器、用户和设备)分发证书。从属 CA 在高度敏感的根 CA 与日常证书颁发之间创建了一个隔离层。
如需生成由您之前创建的根 CA 签名的从属 CA,请执行以下操作:
请求证书
如需使用 CA 请求证书,请执行以下操作:
清理
撤消证书并删除您为本快速入门创建的 CA 池、CA 和项目,以进行清理。