-
Notifications
You must be signed in to change notification settings - Fork 596
Issue with --output-certificate in cosign sign-blob #4140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Good find! It looks like for Can you confirm that the output certificate is actually a base64 encoded key? |
Yes, the output certificate is a base64 encoded key. Example command:
The generated certificate (certificate.crt) contains the encoded public key:
|
Hey so I have been actually trying to look into this but im Still fairly new to this and how it all works, when passing in a key imported by cosign for use /x/crypto/x509 reports out |
Keys shouldn't get parsed by crypto/x509 since that library is for certificates. With the links above, we just need to add a check that the output is actually a certificate. |
Both
cosign sign
andcosign sign-blob
commands support the--output-certificate
parameter, but they behave differently when signing with a private key.Example with cosign sign (image signing):
cosign sign --key cosign.key --output-certificate certificate.crt --output-signature signature.sig --record-creation-timestamp --tlog-upload=false --upload=false hello-world:latest
In this example, when signing an image using cosign sign, the
--output-certificate
flag generates a certificate containing the public key.Example with cosign sign-blob (blob signing):
cosign sign-blob --key cosign.key --output-certificate certificate.crt --output-signature signature.sig --tlog-upload=false test-zip-file.zip
However, when signing a blob using cosign sign-blob, despite the presence of the
--output-certificate
flag, no certificate is generated.My question is:
Why does signing an image generate a certificate with the public key, but signing a blob does not? How does the
--output-certificate
flag work in this context for blobs or in general?I understand that when a blob is signed using the keyless method, a certificate is generated, but this behavior seems different when using the private key for signing.
The text was updated successfully, but these errors were encountered: