kes identity new

概觀

建立新的 KES 身分。

您無法使用此命令將身分新增至無狀態的 KES 實作。相反地,請在組態檔中定義無狀態實作的身分。

命令的輸出類似如下:

Your API key:

   kes:v1:ABuhW1PU/dL1VL41trsQJzYYFMV5FfAcoF7NHu1U9ckk

This is the only time it is shown. Keep it secret and secure!

Your Identity:

   5f1c9dfec3a190f8c3f07d417c223243042fdf8a1df08cfc952a57ee5dc7288e

The identity is not a secret. It can be shared. Any peer
needs this identity in order to verify your API key.

The identity can be computed again via:

    kes identity of kes:v1:ABuhW1PU/dL1VL41trsQJzYYFMV5FfAcoF7NHu1U9ckk

語法

kes identity new [–cert] [–dns] [–encrypt] [–expiry] [–force, -f] [–ip] [–key] []

參數

--cert

選用

新身分的公開憑證路徑。

--key 旗標一起使用。

--dns

選用

指定一個網域名稱作為身分的「主體替代名稱 (SAN)」。您可以重複使用此旗標以將多個網域名稱新增為 SAN。

需要 --key--cert 旗標。

--encrypt

使用密碼加密私密金鑰。

需要 --key--cert 旗標。

--expiry

憑證到期前的時間,格式為 #h 小時。

需要 --key--cert 旗標。

如果未指定,則憑證將在 720h(30 天)後到期。

--force, -f

選用

覆寫該身分可能存在的任何現有私鑰或憑證。

--ip

選用

指定一個 IPv4 位址作為該身分的主體替代名稱 (SAN)。您可以重複使用此標誌來新增多個 IP 作為 SAN。

需要 --key--cert 旗標。

--key

選用

指定要用於新身分的私鑰檔案路徑。

--cert 標誌一起使用。

subject

選用

要用於身分的名稱。如果未指定,KES 會自動產生一個身分。

範例

建立一個具有預設到期時間,並使用金鑰和憑證位置的預設路徑的身分。

$ kes identity new

建立一個使用兩個 IP 位址之一作為主體替代名稱 (SAN) 的身分。

$ kes identity new --ip "192.168.0.182" --ip "10.0.0.92" Client-1

建立一個在預設時間 30 天後過期的加密身分。

$ kes identity new --key client1.key --cert client1.crt --encrypt Client-1

建立一個名為 Client-365 且在 1 年(8760 小時)後過期的加密身分。

$ kes identity new --key server.key --cert server.crt --encrypt --expiry 8760h