Esta página mostra como fazer a rotação de uma chave de maneira automática ou manual. Para mais informações sobre a rotação de chaves em geral, consulte Rotação de chaves.
Funções exigidas
Para conseguir as permissões necessárias para girar chaves, peça ao administrador para conceder a você os seguintes papéis do IAM na chave:
-
Administrador do Cloud KMS (
roles/cloudkms.admin
) -
Criptografar novamente os dados:
Criptografador/Descriptografador de CryptoKey do Cloud KMS (
roles/cloudkms.cryptoKeyEncrypterDecrypter
)
Para mais informações sobre a concessão de papéis, consulte Gerenciar o acesso a projetos, pastas e organizações.
Esses papéis predefinidos contêm as permissões necessárias para girar chaves. Para conferir as permissões exatas necessárias, expanda a seção Permissões necessárias:
Permissões necessárias
As seguintes permissões são necessárias para alternar as chaves:
-
Mudar a versão da chave primária:
cloudkms.cryptoKeys.update
-
Mude ou desative o giro automático:
cloudkms.cryptoKeys.update
-
Crie uma nova versão da chave:
cloudkms.cryptoKeyVersions.create
-
Desativar versões antigas da chave:
cloudkms.cryptoKeyVersions.update
-
Recriptografar dados:
-
cloudkms.cryptoKeyVersions.useToDecrypt
-
cloudkms.cryptoKeyVersions.useToEncrypt
-
Essas permissões também podem ser concedidas com funções personalizadas ou outros papéis predefinidos.
Um único usuário com uma função personalizada que contém todas essas permissões pode rotacionam chaves e recriptografam dados por conta própria. Usuários com o papel de Administrador do Cloud KMS e o papel criptografador/descriptografador de CryptoKey do Cloud KMS podem trabalhar juntos e recriptografar dados. Siga o princípio do menor privilégio ao atribuir papéis. Para mais detalhes, consulte Permissões e papéis.
Quando você faz a rotação de uma chave, os dados criptografados com versões anteriores não são automaticamente recriptografados. Para saber mais, consulte descriptografar e recriptografar. Fazer a rotação de uma chave não desativa ou destrói automaticamente nenhuma versão de chave atual.
Configurar a rotação automática
Para configurar a rotação automática ao criar uma nova chave:
Console
Quando você usa o console do Google Cloud para criar uma chave, o Cloud KMS define período de rotação e o tempo da próxima rotação automaticamente. Você pode usar os valores padrão ou especificar valores diferentes.
Para especificar um período de rotação e um horário de início diferentes, ao criar a chave, mas antes de clicar o botão Criar:
Em Período de rotação de chaves, selecione uma opção.
Em A partir de, selecione a data em que as primeiras campanhas que a rotação aconteça. Você pode deixar Starting on no valor padrão para iniciar a primeira rotação automática um período de rotação de chaves a partir do momento em que a chave é criada.
gcloud
Para usar o Cloud KMS na linha de comando, primeiro instale ou faça upgrade para a versão mais recente da Google Cloud CLI.
gcloud kms keys create KEY_NAME \ --keyring KEY_RING \ --location LOCATION \ --purpose "encryption" \ --rotation-period ROTATION_PERIOD \ --next-rotation-time NEXT_ROTATION_TIME
Substitua:
KEY_NAME
: o nome da chave;KEY_RING
: o nome do keyring que contém a chave.LOCATION
: o local do keyring no Cloud KMS.ROTATION_PERIOD
: o intervalo para alternar a chave. Por exemplo,30d
para alternar a chave a cada 30 dias. A rotação deve ser de no mínimo 1 dia e no máximo 100 anos. Para mais informações, consulte CryptoKey.rotationPeriod (link em inglês).NEXT_ROTATION_TIME
: o carimbo de data/hora em que a primeira é concluída. rotação, por exemplo,2023-01-01T01:02:03
. É possível omitir--next-rotation-time
para programar a primeira rotação para uma rotação período a partir de quando o comando é executado. Para ver mais informações, consulteCryptoKey.nextRotationTime
.
Para informações sobre todas as sinalizações e valores possíveis, execute o comando com a sinalização --help
.
C#
Para executar esse código, primeiro configure um ambiente de desenvolvimento C# e instale o SDK do Cloud KMS para C#.
Go
Para executar esse código, primeiro configure um ambiente de desenvolvimento Go e instale o SDK do Cloud KMS para Go.
Java
Para executar esse código, primeiro configure um ambiente de desenvolvimento Java e instale o SDK do Cloud KMS para Java.
Node.js
Para executar esse código, primeiro configure um ambiente de desenvolvimento do Node.js e instale o SDK do Cloud KMS para Node.js.
PHP
Para executar esse código, primeiro saiba como usar o PHP no Google Cloud e instalar o SDK do Cloud KMS para PHP.
Python
Para executar esse código, primeiro configure um ambiente de desenvolvimento Python e instale o SDK do Cloud KMS para Python.
Ruby
Para executar esse código, primeiro configure um ambiente de desenvolvimento Ruby e instale o SDK do Cloud KMS para Ruby.
API
Estes exemplos usam curl como um cliente HTTP para demonstrar o uso da API. Para mais informações sobre controle de acesso, consulte Como acessar a API Cloud KMS.
Para criar uma chave, use o método
CryptoKey.create
:
curl "https://cloudkms.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys?crypto_key_id=KEY_NAME" \ --request "POST" \ --header "authorization: Bearer TOKEN" \ --header "content-type: application/json" \ --data '{"purpose": "PURPOSE", "rotationPeriod": "ROTATION_PERIOD", "nextRotationTime": "NEXT_ROTATION_TIME"}'
Substitua:
PURPOSE
: a finalidade da chave.ROTATION_PERIOD
: o intervalo fazer a rotação da chave, por exemplo,30d
para fazer a rotação a cada 30 dias. O período de rotação precisa ser de pelo menos um dia e no máximo 100 anos. Para mais informações, consulte CryptoKey.rotationPeriod.NEXT_ROTATION_TIME
: o carimbo de data/hora em que a primeira é concluída. rotação, por exemplo,2023-01-01T01:02:03
. Veja mais informações emCryptoKey.nextRotationTime
.
Para configurar a rotação automática em uma chave atual:
Console
Acesse a página Gerenciamento de chaves no console do Google Cloud.
Clique no nome do keyring que contém a chave para a qual você quer adicionar uma programação de rotação.
Clique na chave em que você quer adicionar uma programação de rotação.
No cabeçalho, clique em Editar período de rotação.
No prompt, escolha novos valores para os campos Período de rotação e A partir de.
No prompt, clique em Salvar.
gcloud
Para usar o Cloud KMS na linha de comando, primeiro Instale ou faça upgrade para a versão mais recente da Google Cloud CLI.
gcloud kms keys update KEY_NAME \ --location LOCATION \ --keyring KEY_RING \ --rotation-period ROTATION_PERIOD \ --next-rotation-time NEXT_ROTATION_TIME
Substitua:
KEY_NAME
: o nome da chave;KEY_RING
: o nome do keyring que contém a chave.LOCATION
: o local do keyring no Cloud KMS.ROTATION_PERIOD
: o intervalo fazer a rotação da chave, por exemplo,30d
para fazer a rotação a cada 30 dias. A rotação deve ser de no mínimo 1 dia e no máximo 100 anos. Para mais informações, consulte CryptoKey.rotationPeriod.NEXT_ROTATION_TIME
: o carimbo de data/hora em que a próxima é concluída. rotação, por exemplo,2023-01-01T01:02:03
. É possível omitir--next-rotation-time
para programar a próxima rotação para uma rotação período a partir de quando o comando é executado. Para ver mais informações, consulteCryptoKey.nextRotationTime
.
Para informações sobre todas as sinalizações e valores possíveis, execute o comando com a sinalização --help
.
C#
Para executar esse código, primeiro configure um ambiente de desenvolvimento C# e instale o SDK do Cloud KMS para C#.
Go
Para executar esse código, primeiro configure um ambiente de desenvolvimento Go e instale o SDK do Cloud KMS para Go.
Java
Para executar esse código, primeiro configure um ambiente de desenvolvimento Java e instale o SDK do Cloud KMS para Java.
Node.js
Para executar esse código, primeiro configure um ambiente de desenvolvimento do Node.js e instale o SDK do Cloud KMS para Node.js.
PHP
Para executar esse código, primeiro saiba como usar o PHP no Google Cloud e instalar o SDK do Cloud KMS para PHP.
Python
Para executar esse código, primeiro configure um ambiente de desenvolvimento Python e instale o SDK do Cloud KMS para Python.
Ruby
Para executar esse código, primeiro configure um ambiente de desenvolvimento Ruby e instale o SDK do Cloud KMS para Ruby.
API
Estes exemplos usam curl como um cliente HTTP para demonstrar o uso da API. Para mais informações sobre controle de acesso, consulte Como acessar a API Cloud KMS.
Para atualizar uma chave, use o
método
CryptoKey.patch
:
curl "https://cloudkms.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME?updateMask=rotationPeriod,nextRotationTime" \ --request "PATCH" \ --header "authorization: Bearer TOKEN" \ --header "content-type: application/json" \ --data '{"rotationPeriod": "ROTATION_PERIOD", "nextRotationTime": "NEXT_ROTATION_TIME"}'
Substitua:
ROTATION_PERIOD
: o intervalo para alternar a chave. Por exemplo,30d
para alternar a chave a cada 30 dias. O período de rotação precisa ser de pelo menos um dia e no máximo 100 anos. Para mais informações, consulte CryptoKey.rotationPeriod (link em inglês).NEXT_ROTATION_TIME
: o carimbo de data/hora em que a próxima é concluída. rotação, por exemplo,2023-01-01T01:02:03
. Veja mais informações emCryptoKey.nextRotationTime
.
Fazer a rotação manual de uma chave
Primeiro, crie uma nova versão da chave:
Console
Acesse a página Gerenciamento de chaves no console do Google Cloud.
Clique no nome do keyring que contém a chave para a qual você criará uma nova versão da chave.
Clique na chave para a qual você criará uma nova versão da chave.
No cabeçalho, clique em Girar.
Na solicitação, clique em Girar para confirmar.
gcloud
Para usar o Cloud KMS na linha de comando, primeiro Instale ou faça upgrade para a versão mais recente da Google Cloud CLI.
gcloud kms keys versions create \ --key KEY_NAME \ --keyring KEY_RING \ --location LOCATION
Substitua:
KEY_NAME
: o nome da chave;KEY_RING
: o nome do keyring que contém a chave.LOCATION
: o local do Cloud KMS do keyring.
As versões de chave são numeradas sequencialmente.
Para informações sobre todas as sinalizações e valores possíveis, execute o comando com a sinalização --help
.
C#
Para executar esse código, primeiro configure um ambiente de desenvolvimento C# e instale o SDK do Cloud KMS para C#.
Go
Para executar esse código, primeiro configure um ambiente de desenvolvimento Go e instale o SDK do Cloud KMS para Go.
Java
Para executar esse código, primeiro configure um ambiente de desenvolvimento Java e instale o SDK do Cloud KMS para Java.
Node.js
Para executar esse código, primeiro configure um ambiente de desenvolvimento do Node.js e instale o SDK do Cloud KMS para Node.js.
PHP
Para executar esse código, primeiro saiba como usar o PHP no Google Cloud e instalar o SDK do Cloud KMS para PHP.
Python
Para executar esse código, primeiro configure um ambiente de desenvolvimento Python e instale o SDK do Cloud KMS para Python.
Ruby
Para executar esse código, primeiro configure um ambiente de desenvolvimento Ruby e instale o SDK do Cloud KMS para Ruby.
API
Estes exemplos usam curl como um cliente HTTP para demonstrar o uso da API. Para mais informações sobre controle de acesso, consulte Como acessar a API Cloud KMS.
Para girar uma chave manualmente, primeiro crie uma nova versão de chave chamando o método CryptoKeyVersions.create.
curl "https://cloudkms.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME/cryptoKeyVersions" \ --request "POST" \ --header "authorization: Bearer TOKEN"
Esse comando cria uma nova versão de chave, mas não a define como a versão primária.
Para definir a nova versão da chave como principal, consulte Como definir uma versão atual como a versão principal da chave.
Se necessário, recriptografe os dados que foram criptografados usando a versão anterior da chave.
Definir uma versão atual como a chave primária
Para definir uma versão de chave diferente como a versão principal de uma chave, atualize a chave com as informações da nova versão principal. Uma versão de chave precisa estar ativada para que você possa configurá-la como a versão principal.
Console
Acesse a página Gerenciamento de chaves no console do Google Cloud.
Clique no nome do keyring que contém a chave cuja versão principal você quer atualizar.
Clique na chave cuja versão principal você quer atualizar.
Na linha correspondente à versão da chave que você quer tornar principal, clique em Ver mais
.Clique em Tornar versão principal no menu.
No prompt de confirmação, clique em Tornar principal.
gcloud
Para usar o Cloud KMS na linha de comando, primeiro Instale ou faça upgrade para a versão mais recente da Google Cloud CLI.
gcloud kms keys update KEY_NAME \ --keyring KEY_RING \ --location LOCATION \ --primary-version KEY_VERSION
Substitua:
KEY_NAME
: o nome da chave;KEY_RING
: o nome do keyring que contém a chave.LOCATION
: o local do keyring no Cloud KMS.- KEY_VERSION: o número da versão da nova chave primária.
Para informações sobre todas as sinalizações e valores possíveis, execute o comando com a sinalização --help
.
C#
Para executar esse código, primeiro configure um ambiente de desenvolvimento C# e instale o SDK do Cloud KMS para C#.
Go
Para executar esse código, primeiro configure um ambiente de desenvolvimento Go e instale o SDK do Cloud KMS para Go.
Java
Para executar esse código, primeiro configure um ambiente de desenvolvimento Java e instale o SDK do Cloud KMS para Java.
Node.js
Para executar esse código, primeiro configure um ambiente de desenvolvimento do Node.js e instale o SDK do Cloud KMS para Node.js.
PHP
Para executar esse código, primeiro saiba como usar o PHP no Google Cloud e instalar o SDK do Cloud KMS para PHP.
Ruby
Para executar esse código, primeiro configure um ambiente de desenvolvimento Ruby e instale o SDK do Cloud KMS para Ruby.
Python
Para executar esse código, primeiro configure um ambiente de desenvolvimento Python e instale o SDK do Cloud KMS para Python.
API
Estes exemplos usam curl como um cliente HTTP para demonstrar o uso da API. Para mais informações sobre controle de acesso, consulte Como acessar a API Cloud KMS.
Altere a versão da chave primária chamando CryptoKey.updatePrimaryVersion .
curl "https://cloudkms.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME:updatePrimaryVersion" \ --request "POST" \ --header "authorization: Bearer TOKEN" \ --header "content-type: application/json" \ --data '{"cryptoKeyVersionId": "KEY_VERSION"}'
Substitua:
PROJECT_ID
: o ID do projeto que contém o chaveiro.LOCATION
: o local do keyring no Cloud KMS.KEY_RING
: o nome do keyring que contém a chave.KEY_NAME
: o nome da chave;- KEY_VERSION: o número da versão da nova chave primária.
Quando você altera a versão da chave primária, a mudança normalmente se torna consistente em 1 minuto. No entanto, essa mudança pode levar até três horas para ser propagada em casos excepcionais. Durante esse período, a versão principal anterior pode ser usada para e criptografar os dados. Para saber mais, consulte Consistência de recursos do Cloud KMS.
Desativar rotação automática
Para fazer isso, limpe a programação de rotação da chave:
Console
Acesse a página Gerenciamento de chaves no console do Google Cloud.
Clique no nome do keyring que contém a chave para a qual você quer remova a programação de rotação.
Clique na chave de onde você quer remover a programação de rotação.
No cabeçalho, clique em Editar período de rotação.
Na solicitação, clique no campo Período de rotação e selecione Nunca (rotação manual).
No prompt, clique em Salvar.
gcloud
Para usar o Cloud KMS na linha de comando, primeiro instale ou faça upgrade para a versão mais recente da Google Cloud CLI.
gcloud kms keys update KEY_NAME \ --keyring KEY_RING \ --location LOCATION \ --remove-rotation-schedule
Substitua:
KEY_NAME
: o nome da chave;KEY_RING
: o nome do keyring que contém a chave.LOCATION
: o local do keyring no Cloud KMS.
Para informações sobre todas as sinalizações e valores possíveis, execute o comando com a sinalização --help
.
C#
Para executar esse código, primeiro configure um ambiente de desenvolvimento C# e instale o SDK do Cloud KMS para C#.
Go
Para executar esse código, primeiro configure um ambiente de desenvolvimento Go e instale o SDK do Cloud KMS para Go.
Java
Para executar esse código, primeiro configure um ambiente de desenvolvimento Java e instale o SDK do Cloud KMS para Java.
Node.js
Para executar esse código, primeiro configure um ambiente de desenvolvimento do Node.js e instale o SDK do Cloud KMS para Node.js.
PHP
Para executar esse código, primeiro saiba como usar o PHP no Google Cloud e instalar o SDK do Cloud KMS para PHP.
Ruby
Para executar esse código, primeiro configure um ambiente de desenvolvimento Ruby e instale o SDK do Cloud KMS para Ruby.
Python
Para executar esse código, primeiro configure um ambiente de desenvolvimento Python e instale o SDK do Cloud KMS para Python.
API
Estes exemplos usam curl como um cliente HTTP para demonstrar o uso da API. Para mais informações sobre controle de acesso, consulte Como acessar a API Cloud KMS.
Para atualizar uma chave, use o
método
CryptoKey.patch
:
curl "https://cloudkms.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY_NAME?updateMask=rotationPeriod,nextRotationTime" \ --request "PATCH" \ --header "authorization: Bearer TOKEN" \ --header "content-type: application/json" \ --data '{"rotationPeriod": null, "nextRotationTime": null}'
Para acessar mais detalhes sobre rotationPeriod
e nextRotationTime
, consulte
keyRings.cryptoKeys
.
Girar uma chave externa
Girar uma chave externa coordenada
É possível configurar a rotação automática para chaves externas simétricas coordenadas. Também é possível criar manualmente uma nova versão de chave para versões chaves externas coordenadas assimétricas.
A rotação ou a criação de uma nova versão de chave faz com que todos os dados recém-criados sejam protegidos com essa chave sejam criptografados com a nova versão. Os dados protegidos com uma versão anterior da chave não são recriptografados. Como resultado, o gerenciador de chaves externo precisa continuar disponibilizando o material da chave da versão anterior para uso.
Para criar uma nova versão para uma chave externa coordenada, siga estas etapas:
Console
No console do Google Cloud, acesse Gerenciamento de chaves.
Selecione o keyring e a chave.
Clique em Criar versão. Uma mensagem indica que a nova versão da chave será gerada no Cloud KMS e no EKM. Se aparecer um Caminho da chave ou URI da chave, a chave selecionada não é um campo coordenado chave externa.
Para confirmar que você quer criar uma nova versão da chave, clique em Criar versão.
A nova versão da chave aparece no estado Geração pendente. Para simétrico as versões de chave criadas manualmente não são definidas automaticamente como versão da chave primária. É possível definir a nova versão da chave como principal.
CLI da gcloud
Para criar uma nova versão de chave simétrica e defini-la como a versão de chave principal,
use o comando kms keys versions create
com a flag --primary
:
gcloud kms keys versions create \ --key KEY_NAME \ --keyring KEY_RING \ --location LOCATION \ --primary
Substitua:
KEY_NAME
: o nome da chave;KEY_RING
: o nome do keyring que contém a chave.LOCATION
: o local do Cloud KMS do keyring.
Para criar uma nova versão de chave assimétrica ou criar uma nova chave simétrica
que não seja a versão da chave primária, use o comando kms keys versions
create
:
gcloud kms keys versions create \ --key KEY_NAME \ --keyring KEY_RING \ --location LOCATION
Substitua:
KEY_NAME
: o nome da chave;KEY_RING
: o nome do keyring que contém a chave.LOCATION
: o local do Cloud KMS do keyring.
Fazer a rotação de um Cloud EKM gerenciado manualmente usando uma chave VPC
Primeiro, gire o material da chave externa no gerenciador de chaves externo. Se isso resultar em um novo caminho de chave, será preciso girar ou criar um novo Cloud EKM versão da chave com o novo caminho. Para chaves de criptografia simétrica, rotate a Chave do Cloud EKM e especifique o novo caminho da chave externa de projeto. Para chaves assimétricas, crie uma nova versão da chave e especifique uma nova. caminho.
A rotação ou a criação de uma nova versão de chave faz com que todos os dados recém-criados sejam protegidos com essa chave sejam criptografados com a nova versão. Os dados protegidos com uma versão anterior da chave não são recriptografados. Como resultado, o gerenciador de chaves externo precisa continuar disponibilizando o material da chave da versão anterior para uso.
Se o material da chave no sistema do parceiro de gerenciamento de chaves externas não mudar, mas o caminho da chave mudar, atualize o caminho externo da chave sem girar a chave.
Console
No console do Google Cloud, acesse Gerenciamento de chaves.
Selecione o keyring e a chave.
Clique em Girar chave.
Em Caminho da chave, insira o caminho da chave para a nova versão.
Clique em Alternar chave para confirmar.
gcloud
Para usar o Cloud KMS na linha de comando, primeiro instale ou faça upgrade para a versão mais recente da Google Cloud CLI.
Para criar uma nova versão de chave simétrica e defini-la como a versão da chave primária,
Use o comando kms keys versions create
com a sinalização --primary
:
gcloud kms keys versions create \ --key KEY_NAME \ --keyring KEY_RING \ --location LOCATION \ --ekm-connection-key-path EXTERNAL_KEY_PATH \ --primary
Substitua:
KEY_NAME
: o nome da chave;KEY_RING
: o nome do keyring que contém a chave.LOCATION
: o local do Cloud KMS do keyring.EXTERNAL_KEY_PATH
: o caminho para o novo arquivo externo. a versão da chave.
Para criar uma nova versão de chave assimétrica ou uma versão de chave simétrica
que não seja a versão da chave primária, use o comando kms keys versions
create
:
gcloud kms keys versions create \ --key KEY_NAME \ --keyring KEY_RING \ --location LOCATION \ --ekm-connection-key-path EXTERNAL_KEY_PATH
Substitua:
KEY_NAME
: o nome da chave;KEY_RING
: o nome do keyring que contém a chave.LOCATION
: o local do Cloud KMS do keyring.EXTERNAL_KEY_PATH
: o caminho para o novo arquivo externo. a versão da chave.
Para informações sobre todas as sinalizações e valores possíveis, execute o comando com a sinalização --help
.
Depois que a versão da chave for criada, ela poderá ser usada como qualquer outra versão de chave do Cloud KMS.
Alternar um Cloud EKM gerenciado manualmente usando uma chave de Internet
Primeiro, gire o material da chave externa no gerenciador de chaves externo. Se isso resultar em um novo URI, será preciso girar ou criar uma nova chave do Cloud EKM com o novo URI. Para chaves de criptografia simétrica, alterne a chave do Cloud EKM e especifique o novo URI da chave do gerenciador de chaves externas. Para chaves assimétricas, crie uma nova versão de chave e especifique o novo URI da chave.
A rotação ou a criação de uma nova versão de chave faz com que todos os dados recém-criados sejam protegidos com essa chave sejam criptografados com a nova versão. Os dados protegidos com uma versão anterior da chave não são recriptografados. Por isso, sua chave externa de chave deve continuar fazendo o material da chave da versão anterior disponíveis para uso.
Se o material da chave no sistema do parceiro de gerenciamento de chaves externas não mudar, mas o URI mudar, atualize o URI externo da chave sem girar a chave.
Console
No console do Google Cloud, acesse a página Gerenciamento de chaves.
Selecione o keyring e a chave.
Selecione Alternar chave para chaves simétricas ou Criar versão para chaves assimétricas.
Insira o URI da nova chave e selecione Alternar chave para chaves simétricas ou Crie uma versão para chaves assimétricas.
A nova versão da chave se torna a principal.
CLI da gcloud
Para criar uma nova versão de chave simétrica e defini-la como a versão de chave principal,
use o comando kms keys versions create
com a flag --primary
:
gcloud kms keys versions create \ --key KEY_NAME \ --keyring KEY_RING \ --location LOCATION \ --external-key-uri EXTERNAL_KEY_URI \ --primary
Substitua:
KEY_NAME
: o nome da chave;KEY_RING
: o nome do keyring que contém a chave.LOCATION
: o local do Cloud KMS do keyring.EXTERNAL_KEY_URI
: o URI da chave do novo objeto externo. a versão da chave.
Para criar uma nova versão de chave assimétrica ou uma versão de chave simétrica
que não seja a versão da chave primária, use o comando kms keys versions
create
:
gcloud kms keys versions create \ --key KEY_NAME \ --keyring KEY_RING \ --location LOCATION \ --external-key-uri EXTERNAL_KEY_URI
Substitua:
KEY_NAME
: o nome da chave;KEY_RING
: o nome do keyring que contém a chave.LOCATION
: o local do Cloud KMS do keyring.EXTERNAL_KEY_URI
: o URI da chave da nova versão de chave externa.