Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Key Management Service
  • Getting started
    • All guides
      • Digital signature key pair
      • Access permissions for a digital signature key pair
      • Digital signature and its verification
      • Digital signature of files and artifacts using Cosign
    • Viewing operations on service resources
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • FAQ

In this article:

  • Getting started
  • Sign a local file
  • Verify the digital signature
  1. Step-by-step guides
  2. Digital signature
  3. Digital signature of files and artifacts using Cosign

Digitally signing files and artifacts using Cosign

Written by
Yandex Cloud
Updated at July 20, 2026
View in Markdown
  • Getting started
  • Sign a local file
  • Verify the digital signature

You can use digital signature key pairs created with the Cosign utility in Key Management Service. A special build of Cosign allows you to store the created key pair in KMS, sign files and artifacts with the pair's private key, and verify a digital signature using its public key.

Getting startedGetting started

  1. Install a special Cosign build for your OS:

    • Linux amd64
    • MacOS Darwin amd64
    • MacOS Darwin arm64
    • Windows
  2. Get an IAM token and save it to the $YC_IAM_TOKEN environment variable:

    Bash
    PowerShell
    export YC_IAM_TOKEN=$(yc iam create-token)
    
    $env:YC_IAM_TOKEN = $(yc iam create-token)
    

Sign a local fileSign a local file

  1. Create a digital signature key pair and save it to KMS:

    cosign generate-key-pair \
      --kms yckms:///folder/<folder_ID>/keyname/<key_pair_name>
    

    Where:

    • <folder_ID>: ID of the folder to save the new key pair to.
    • <key_pair_name>: Name of the signature key pair you are creating.

    Result:

    client.go:183: Using IAM Token from 'YC_IAM_TOKEN' environment variable as credentials
    client.go:310: generated yckms KEY_ID: 'abj15qhhh98d********'
    Public key written to cosign.pub
    

    The utility will return the ID of the created signature key pair and save a public signature key to a local file. Save the key pair ID, you will need it in the next steps.

    You can always get the ID of your signature key pair in the management console or using a CLI command.

  2. Sign a local file:

    cosign sign-blob \
      --key yckms:///<key_pair_ID> \
      --tlog-upload=false \
      <file_path>
    

    Where:

    • <key_pair_ID>: ID of the signature key pair you got in the previous step.
    • <path_to_file>: Path to the local file you want to sign.

    Result:

    Using payload from: <file_path>
    client.go:183: Using IAM Token from 'YC_IAM_TOKEN' environment variable as credentials
    <digital_signature_value>
    

    Save the resulting digital signature value. You will need it for signature verification in the next step.

Verify the digital signatureVerify the digital signature

To verify the signature, run the following command:

cosign verify-blob \
  --key yckms:///<key_pair_ID> \
  --insecure-ignore-tlog \
  --signature "<digital_signature_value>" \
  <file_path>

Where:

  • --key: Signature key pair ID obtained earlier.
  • --signature: Digital signature value obtained in the previous step.
  • <path_to_file>: Path to the local file whose signature you want to verify.

Result:

WARNING: Skipping tlog verification is an insecure practice that lacks of transparency and auditability verification for the blob.
client.go:183: Using IAM Token from 'YC_IAM_TOKEN' environment variable as credentials
Verified OK

Useful linksUseful links

Signing and verifying Container Registry Docker images in Managed Service for Kubernetes

Was the article helpful?

Previous
Digital signature and its verification
Next
Viewing operations on service resources
© 2026 Direct Cursus Technology L.L.C.