
Software supply chains have become more complex and increasingly targeted, making container image security a fundamental requirement for building trust in modern delivery pipelines.
By signing images with Cosign and protecting signing keys in OVHcloud KMS, teams can keep cryptographic material out of local environments and CI/CD variables, all while making image signing easier to control, audit and integrate into delivery pipelines.
In this blog post, you will learn how to use the OVHcloud KMS plugin for Cosign to generate a key, sign a container image with this key and verify that the OCI image has been correctly signed.
Cosign

Cosign is a tool from the Sigstore project used to sign, verify, and attest OCI container images and software artifacts.
Cosign supports several signing modes, including keyless signing through Sigstore, where short-lived certificates are generated at signing time based on your identity (via GitHub, Google or another OIDC provider), as well as ephemeral key generation, hardware and KMS-backed signing and custom PKI integration.
Cosign supports multiple KMS providers to generate and sign keys. Several external KMS providers are supported, including HashiCorp Vault, AWS KMS, GCP KMS and Azure Key Vault.
Cosign can now also be integrated with OVHcloud KMS through the Sigstore Cosign OVHcloud KMS plugin 💪.
OVHcloud Key Management Service (KMS)

OVHcloud KMS, often called OKMS, is a managed service that centralizes the creation, storage, and management of encryption keys. Its main goal is to help businesses secure data and control cryptographic operations from a single platform.
Each KMS is associated with a region, so the keys stored in that region are guaranteed to stay in that region. You can order multiple KMSs, either in different regions or in the same region.
Prerequisites
To be able to use the Sigstore KMS OVHcloud provider, you need to follow some prerequisites:
- Have an OVHcloud account
- Have created an OKMS domain (“
305db938-1234-5678-9012-3a0a29291661” for example in this blog post) - Have created an IAM local user (“cosign-
305db938-1234-5678-9012-3a0a29291661” for example in this blog post) - Have installed the OVHcloud CLI
- Have uuidgen CLI installed
💡The cosign OVHcloud plugin supports both token and mTLS authentication. For the purposes of this blog post, we will use the token authentication mode. Please follow the Sigstore Cosign KMS plugin for OVHcloud guide if you wish to use mTLS authentication mode.
Generate a PAT token (for token authentication only)
List the OKMS domains:
$ ovhcloud okms list
┌──────────────────────────────────────┬─────────────┐
│ id │ region │
├──────────────────────────────────────┼─────────────┤
│ 305db938-1234-5678-9012-3a0a29291661 │ eu-west-par │
│ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx │ eu-west-par │
└──────────────────────────────────────┴─────────────┘
Save the OKMS ID in an environment variable:
export KMS_RESTAPI_OKMSID="305db938-1234-5678-9012-3a0a29291661"
The cosign OVHcloud plugin needs the permission to create and fetch keys from the OVHcloud KMS.
If you want to use token autentication, you’ll need a token (PAT). You can use the ovhcloud CLI to do that:
PAT_TOKEN=$(ovhcloud iam user token create <iam-local-user-name> --name pat-<iam-local-user-name> --description "PAT cosign for domain $KMS_RESTAPI_OKMSID" -o json | jq .details.token | tr -d '"')
echo $PAT_TOKEN
You should have a result like this:
$ PAT_TOKEN=$(ovhcloud iam user token create cosign-305db938-1234-5678-9012-3a0a29291661 --name pat-cosign-305db938-1234-5678-9012-3a0a29291661 --description "PAT cosign for domain 305db938-1234-5678-9012-3a0a29291661" -o json | jq .details.token | tr -d '"')
2026/05/07 08:48:34 Final parameters:
{
"description": "PAT cosign for domain 305db938-1234-5678-9012-3a0a29291661",
"name": "pat-cosign-305db938-1234-5678-9012-3a0a29291661"
}
$ echo $PAT_TOKEN
eyJhbGciOiJFZE...ASgXy55_DDFHdy4Z5uSq8lww-Bw
Save the KMS information
Save the KMS information in environment variables. For example:
export KMS_RESTAPI_ENDPOINT=$(ovhcloud okms get $KMS_RESTAPI_OKMSID -o json | jq .restEndpoint | xargs)
export KMS_RESTAPI_TYPE="token"
export KMS_RESTAPI_TOKEN=$PAT_TOKEN
Display the saved information:
$ echo $KMS_RESTAPI_ENDPOINT
https://eu-west-par.okms.ovh.net
$ echo $KMS_RESTAPI_OKMSID
305db938-1234-5678-9012-3a0a29291661
$ echo $KMS_RESTAPI_TYPE
token
$ echo $KMS_RESTAPI_TOKEN
eyJ...BIoHCA
Cosign KMS plugin installation
Install the plugin locally:
curl -fsSL https://raw.githubusercontent.com/ovh/sigstore-kms-ovhcloud/main/install.sh | sh
⚠️ The binary is installed in $HOME/.local/bin by default (created if it does not exist). Make sure this directory is in your PATH.
Or follow the other installation methods.
Now you can use the OVHcloud KMS plugin directly in the cosign command 🎉.
Let’s use Cosign with the OVHcloud KMS!
Generate a key
First, to sign an image, we need to generate a key pair. To do that we need to generate a UUID and use it in the cosign generate-key-pair command.
export KEY_ID=$(uuidgen)
cosign generate-key-pair --kms ovhcloud://$KEY_ID
The signing key is created in OVHcloud KMS, and the public key is written locally.
You should see an output like this:
$ export KEY_ID=$(uuidgen)
$ cosign generate-key-pair --kms ovhcloud://$KEY_ID
Public key written to cosign.pub
The command generates a key pair using the ECDSA algorithm and writes the public key to cosign.pub.
Check the keys have been created:
$ ls -l cosign.pub
-rw------- 1 avache staff 178 18 juin 16:06 cosign.pub
$ cat cosign.pub
-----BEGIN PUBLIC KEY-----
MFkw...QgwA==
-----END PUBLIC KEY-----
Once the key pair has been generated, use the corresponding OVHcloud KMS key ID in the ovhcloud://$KEY_ID URI when signing and verifying images.
Or get an existing public key (optional)
Instead of creating a new public key, you can retrieve an existing one with the following command:
cosign public-key --key ovhcloud://$KEY_ID --outfile cosign-ovhcloud.pub
Sign an image
Replace the $IMAGE@sha256:$HASH parameter with the URI to your image and the hash to your image and execute this command:
cosign sign --key ovhcloud://$KEY_ID $IMAGE@sha256:$HASH
You should see an output like this:
$ cosign sign --key ovhcloud://$KEY_ID 12345678.c1.de1.container-registry.ovh.net/my-project/my-image@sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Verify the image has been signed
cosign verify --key ovhcloud://$KEY_ID $IMAGE@sha256:$HASH
You should see an output like this:
$ cosign verify --key ovhcloud://$KEY_ID 12345678.c1.de1.container-registry.ovh.net/my-project/my-image@sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Verification for 12345678.c1.de1.container-registry.ovh.net/my-project/my-image@sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx --
The following checks were performed on each of these signatures:
- The cosign claims were validated
- Existence of the claims in the transparency log was verified offline
- The signatures were verified against the specified public key
[{"critical":{"identity":{"docker-reference":"12345678.c1.de1.container-registry.ovh.net/my-project/my-image@sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"},"image":{"docker-manifest-digest":"sha256:b1202...2334e2"},"type":"https://sigstore.dev/cosign/sign/v1"},"optional":{}}]
Conclusion
In this blog post, we have shown how to use Cosign with the OVHcloud KMS plugin to generate a key pair, sign a container image and verify its signature.
By keeping signing keys in a managed KMS, teams can reduce secret sprawl, protect sensitive cryptographic material and make image signing easier to integrate into secure CI/CD workflows.
Feel free to take a look at our Cloud Roadmap & Changelog to follow the latest features coming to OVHcloud Public Cloud products.
Developer Advocate at OVHcloud, specializing in Cloud Native, Infrastructure as Code, and Developer Experience.
Docker Captain, CNCF Ambassador, Google Developer Expert, and Women Techmakers Ambassador, she has spent more than 20 years helping developers and operators build reliable cloud-native platforms. Passionate about DevOps, Kubernetes, and Go, she shares best practices through technical writing, international conferences, and visual learning resources.
Author of the Understanding Kubernetes, Understanding Docker, and Understanding Istio series, she pioneered a visual approach to learning cloud technologies through sketchnotes, books, and videos.