Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Der AO führt Signier- und Prüfvorgänge über Google Distributed Cloud (GDC) aus, die über einen gRPC-Client vom KMS getrennt sind.
Hinweise
Bitten Sie Ihren IAM-Administrator der Organisation, Ihnen die Rolle „KMS Developer“ (kms-developer) in Ihrem Projekt-Namespace zuzuweisen, um die erforderlichen Berechtigungen zum Signieren von Daten zu erhalten.
Daten signieren
Verwenden Sie den Befehl gdcloud kms keys asymmetric-sign, um Daten zu signieren. Mit diesem Befehl wird eine digitale Signatur einer Eingabedatei mit dem Signing-Schlüssel erstellt und die base64-codierte Signatur gespeichert.
Um Ihre Daten zu signieren, übergeben Sie den Schlüsselnamen und Folgendes:
NAMESPACE: der Projekt-Namespace, z. B. kms-test1.
KEY_NAME: der Name des Schlüssels, der zum Signieren verwendet wird, z. B. key-1.
INPUT_PATH: Der Pfad der Eingabedatei, die signiert werden soll.
SIGNATURE_FILE: Der Pfad der Ausgabedatei, in der die base64-codierte Signatur gespeichert werden soll.
Nach der Ausführung des Befehls wird eine Ausgabedatei angezeigt, die Sie im Flag --signature-file angegeben haben und die die base64-codierte Signatur enthält.
Daten überprüfen
Nachdem Sie Ihre Daten signiert haben, überprüfen Sie die base64-digitale Signatur mit dem Befehl gdcloud kms keys asymmetric-verify. Mit diesem Befehl wird geprüft, ob die base64-codierte digitale Signatur, die Sie nach Ausführung des Befehls gdcloud kms keys asymmetric-sign erhalten, gültig ist.
Um die Signatur zu prüfen, übergeben Sie die Signaturdatei und Folgendes:
Nach der Ausführung des Befehls wird bei Erfolg die Ausgabe Verification OK angezeigt. Wenn nicht, wird die Fehlerausgabe Verification Failure angezeigt.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eThe system utilizes Google Distributed Cloud (GDC) air-gapped to the KMS through a gRPC client for sign and verify operations.\u003c/p\u003e\n"],["\u003cp\u003eUsers need the KMS Developer (\u003ccode\u003ekms-developer\u003c/code\u003e) role in their project namespace to obtain the necessary permissions for signing data.\u003c/p\u003e\n"],["\u003cp\u003eData signing is performed using the \u003ccode\u003egdcloud kms keys asymmetric-sign\u003c/code\u003e command, which requires specifying the key name, input file path, and output signature file path.\u003c/p\u003e\n"],["\u003cp\u003eData verification is done using the \u003ccode\u003egdcloud kms keys asymmetric-verify\u003c/code\u003e command, confirming the validity of the base64 encoded digital signature from the signing process.\u003c/p\u003e\n"],["\u003cp\u003eThe verification process might fail if the input or signature file paths are incorrect or if the signature file is empty.\u003c/p\u003e\n"]]],[],null,["# Sign and verify data\n\nThe AO performs sign and verify operations through Google Distributed Cloud (GDC) air-gapped\nto the KMS through a gRPC client.\n\nBefore you begin\n----------------\n\nTo get the required permissions to sign data, ask your Organization IAM Admin to\ngrant you the KMS Developer (`kms-developer`) role in your project namespace.\n\nSign data\n---------\n\nTo sign data, use the `gdcloud kms keys asymmetric-sign` command. This command\ncreates a digital signature of an input file using the `Signing` key, and saves\nthe base64 encoded signature.\n\n- To sign your data, pass in the key name and the following:\n\n gdcloud kms keys asymmetric-sign \\\n namespaces/\u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e/signingKeys/\u003cvar translate=\"no\"\u003eKEY_NAME\u003c/var\u003e \\\n --input-file=\u003cvar translate=\"no\"\u003eINPUT_PATH\u003c/var\u003e \\\n --signature-file=\u003cvar translate=\"no\"\u003eSIGNATURE_FILE\u003c/var\u003e\n\n Replace the following variables:\n - \u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e: the project namespace---for example: `kms-test1`.\n - \u003cvar translate=\"no\"\u003eKEY_NAME\u003c/var\u003e: the name of the key used to sign---for example: `key-1`.\n - \u003cvar translate=\"no\"\u003eINPUT_PATH\u003c/var\u003e: the path of the input file you want to have signed.\n - \u003cvar translate=\"no\"\u003eSIGNATURE_FILE\u003c/var\u003e: the path of the output file to save the base64 encoded signature.\n\n After running the command, you see an output file you specified in the\n `--signature-file` flag that contains the base64 encoded signature.\n\nVerify data\n-----------\n\nAfter signing your data, verify the base64 digital signature using\nthe `gdcloud kms keys asymmetric-verify` command. This command verifies whether\nor not the base64 encoded digital signature you receive after running the\n`gdcloud kms keys asymmetric-sign` command is valid.\n\n- To verify the signature, pass in the signature file and the following:\n\n gdcloud kms keys asymmetric-verify \\\n namespaces/\u003cvar translate=\"no\"\u003eNAMESPACE\u003c/var\u003e/signingKeys/\u003cvar translate=\"no\"\u003eKEY_NAME\u003c/var\u003e \\\n --input-file=\u003cvar translate=\"no\"\u003eINPUT_PATH\u003c/var\u003e \\\n --signature-file=\u003cvar translate=\"no\"\u003eSIGNATURE_FILE\u003c/var\u003e\n\n After running the command, you see the output `Verification OK` if\n successful. If not successful, you see the failure output\n `Verification Failure`.\n\n| **Note:** The failure output `Verification Failure` might result if the paths of the signature and input files are not correct, and if the signature file is empty."]]