Prerequisites
- A Sign/Verify key
- The Member role to follow the UI steps, or the Cryptographic Operator role to follow the API steps (see Who can use a key)
Signing algorithms
When you sign or verify data, you choose a signing algorithm that matches the key’s algorithm:
RSASSA-PSS and ECDSA produce a different signature each time you sign the same data. RSASSA-PKCS1-v1.5 and Ed25519 always produce the same signature for the same data.
To list the signing algorithms for a key, call the signing algorithms endpoint.
Sign data
- Infisical UI
- API
1
In your KMS project, go to Overview, select the options menu on the key’s row, then select Sign Data.
2
Enter your data in Data to Sign, and pick a Signing Algorithm. If your data is already Base64 encoded, turn on Data is Base64 encoded.
3
Select Sign, then copy the signature from Data Signature.
Verify a signature
- Infisical UI
- API
1
In your KMS project, go to Overview, select the options menu on the row of the key that signed the data, then select Verify Data.
2
Enter the data in Data to Verify and the signature in Signature of Data, then pick the Signing Algorithm that the data was signed with. If your data is already Base64 encoded, turn on Data is Base64 encoded.
3
Select Verify. Signature Status shows Valid if the signature matches the data, and Invalid if it doesn’t.
Sign a digest
If your data is large, or you don’t want to send it to Infisical, you can hash the data yourself and sign the hash (the digest) instead. Digests work only with theRSASSA_PKCS1_V1_5_* and ECDSA_* signing algorithms.
1
Hash your data with the hash function in the signing algorithm’s name, and Base64 encode the result. For example, for
RSASSA_PKCS1_V1_5_SHA_512, create a SHA-512 digest:2
Call the sign endpoint with the digest as
data, and add "isDigest": true:"isDigest": true to the verify endpoint in the same way.