Use cosign import-key to import an existing PEM-encoded private key for use with cosign sign

domain: sigstore.dev · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Obtain the existing PEM-encoded EC or RSA private key you want to import into cosign's key format
  2. Run 'cosign import-key --key <path-to-pem-file>' to produce a cosign-formatted key file; cosign will prompt for a password to encrypt the resulting key
  3. Store the resulting cosign key file and its password securely, using a secrets manager or encrypted storage
  4. Sign an artifact using the imported key by running 'cosign sign --key cosign.key <image>@<digest>' and entering the key password when prompted or via the COSIGN_PASSWORD environment variable
  5. Verify the signature using 'cosign verify --key cosign.pub <image>@<digest>' where cosign.pub is the corresponding public key exported alongside the import

Known gotchas

Related routes

Sign a container image keylessly with cosign and attach the signature to the registry using the cosign sign command
sigstore.dev · 5 steps · unrated
Attach a signed SBOM attestation to an OCI image using cosign attest
docs.sigstore.dev · 6 steps · unrated
Attach and verify a cosign attestation for an SBOM linked to a container image
docs.sigstore.dev · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans