Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Esportazione di una chiave asimmetrica con CLI CloudhSM
Utilizzate il key generate-file comando nella CLI di CloudHSM per esportare una chiave asimmetrica dal modulo di sicurezza hardware (HSM). Se la destinazione è una chiave privata, il riferimento alla chiave privata verrà esportato in formato PEM falso. Se la destinazione è una chiave pubblica, i byte della chiave pubblica verranno esportati in formato PEM.
Il file PEM falso, che non contiene l'effettivo materiale della chiave privata ma fa invece riferimento alla chiave privata nell'HSM, può essere utilizzato per stabilire l' SSL/TLS offload dal server Web a. AWS CloudHSM Per ulteriori informazioni, vedi Offload SSL/TLS.
Tipo di utente
I seguenti tipi di utenti possono eseguire questo comando.
-
Utenti Crypto () CUs
Requisiti
Per eseguire questo comando, è necessario aver effettuato l'accesso come CU.
Sintassi
aws-cloudhsm >
help key generate-file
Generate a key file from a key in the HSM cluster. This command does not export any private key data from the HSM Usage: key generate-file --encoding
<ENCODING>
--path<PATH>
--filter [<FILTER>
...] Options: --cluster-id<CLUSTER_ID>
Unique Id to choose which of the clusters in the config file to run the operation against. If not provided, will fall back to the value provided when interactive mode was started, or error --encoding<ENCODING>
Encoding format for the key file Possible values: - reference-pem: PEM formatted key reference (supports private keys) - pem: PEM format (supports public keys) --path<PATH>
Filepath where the key file will be written --filter [<FILTER>
...] Key reference (e.g. key-reference=0xabc) or space separated list of key attributes in the form of attr.KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE to select a matching key for file generation -h, --help Print help (see a summary with '-h')
Esempio
Questo esempio mostra come utilizzare key generate-file per generare un file chiave nel AWS CloudHSM cluster.
aws-cloudhsm >
key generate-file --encoding reference-pem --path /tmp/ec-private-key.pem --filter attr.label="ec-test-private-key"
{ "error_code": 0, "data": { "message": "Successfully generated key file" } }
Argomenti
<CLUSTER_ID>
-
L'ID del cluster su cui eseguire questa operazione.
Obbligatorio: se sono stati configurati più cluster.
<FILTER>
-
Riferimento alla chiave (ad esempio,
key-reference=0xabc
) o elenco separato da spazi degli attributi chiave sotto forma di selezioneattr.KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE
di una chiave corrispondente da eliminare.Per un elenco degli attributi chiave della CLI di CloudHSM supportati, vedi Attributi chiave per la CLI di CloudHSM
Campo obbligatorio: no
<ENCODING>
-
Specifica il formato di codifica per il file di chiavi
Campo obbligatorio: sì
<PATH>
-
Specifica il percorso del file in cui verrà scritto il file di chiavi
Campo obbligatorio: sì
Generazione di riferimenti chiave KSP (Windows)
Nota
Questa funzionalità è disponibile solo nella versione SDK 5.16.0 e successive.
Prerequisiti
-
È possibile generare riferimenti chiave KSP solo su piattaforme Windows.
-
Devi accedere come utente crittografico (CU).
Posizione del file
Per impostazione predefinita, AWS CloudHSM archivia i file generati in: C:\Users\Default\AppData\Roaming\Microsoft\Crypto\CaviumKSP\GlobalPartition
Per specificare una posizione diversa, usa il --path
parametro.
Sintassi
aws-cloudhsm >
help key generate-file --encoding ksp-key-reference
Generate a key file from a key in the HSM cluster. This command does not export any private key data from the HSM Usage: key generate-file --encoding
<ENCODING>
--path<PATH>
--filter [<FILTER>
...] Options: --encoding<ENCODING>
Encoding format for the key file Possible values: - reference-pem: PEM formatted key reference (supports private keys) - pem: PEM format (supports public keys) - ksp-key-reference: KSP key reference format --cluster-id<CLUSTER_ID>
Unique Id to choose which of the clusters in the config file to run the operation against. If not provided with multiple clusters configured, will error --path<PATH>
Directory path where the key file will be written --filter [<FILTER>...] Key reference (e.g. key-reference=0xabc) or space separated list of key attributes in the form of attr.KEY_ATTRIBUTE_NAME=KEY_ATTRIBUTE_VALUE to select a matching key for file generation --all Generate ksp key reference for all available key pairs in HSM -h, --help Print help (see a summary with '-h')
Esempio: genera un riferimento a una chiave KSP utilizzando un filtro di attributi di una chiave privata
L'esempio seguente genera un riferimento alla chiave KSP per una chiave privata con un'etichetta specifica.
aws-cloudhsm >
key generate-file --encoding ksp-key-reference --path --filter attr.label="ec-test-private-key"
{ "error_code": 0, "data": { "message": "Successfully generated key file" } }
Esempio: genera riferimenti chiave KSP per tutte le coppie di chiavi
L'esempio seguente genera riferimenti alle chiavi KSP per tutte le coppie di chiavi del cluster.
aws-cloudhsm >
key generate-file --encoding ksp-key-reference --all
{ "error_code": 0, "data": { "message": "Successfully generated key file" } }