使用您的憑證授權機構憑證建立用戶端憑證 - AWS IoT Core

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

使用您的憑證授權機構憑證建立用戶端憑證

您可以使用自己的憑證授權機構 (CA) 來建立用戶端憑證。用戶端憑證必須在 AWS IoT 使用前。如需用戶端憑證之註冊選項的詳細資訊,請參閱 註冊用戶端憑證

建立用戶端憑證 (CLI)

注意

您無法在中執行此程序 AWS IoT 控制台。

使用建立用戶端憑證 AWS CLI
  1. 產生金鑰對。

    openssl genrsa -out device_cert_key_filename.key 2048
  2. CSR為用戶端憑證建立。

    openssl req -new \ -key device_cert_key_filename.key \ -out device_cert_csr_filename.csr

    將出現提示,要求您輸入一些資訊,如下所示:

    You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]: State or Province Name (full name) []: Locality Name (for example, city) []: Organization Name (for example, company) []: Organizational Unit Name (for example, section) []: Common Name (e.g. server FQDN or YOUR name) []: Email Address []: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []:
  3. 從建立用戶端憑證CSR。

    openssl x509 -req \ -in device_cert_csr_filename.csr \ -CA root_CA_cert_filename.pem \ -CAkey root_CA_key_filename.key \ -CAcreateserial \ -out device_cert_filename.pem \ -days 500 -sha256

此時,已建立用戶端憑證,但尚未註冊 AWS IoT。 如需註冊用戶端憑證的方式和時機的詳細資訊,請參閱註冊用戶端憑證