Skip to content

Conversation

V02460
Copy link
Contributor

@V02460 V02460 commented Aug 8, 2025

Implements deriving a key’s ID if no explicit kid is provided. Contains unit tests and documentation.

secrets.keys.[].kid can now be omitted and in this case the kid is automatically derived. If the field is set, the behavior is the same as before.

Edit: The derived kid is now the key’s RFC 7638 JWK Thumbprint.

The derived kid is based on a key’s fingerprint: it simply takes the first four bytes and hex-encodes them.

For creating the fingerprinting function I took inspiration from how OpenSSH and AWS are doing their key fingerprinting. They take some canonical byte-representation and hash them, but differ in the used hashing function and whether the private key or corresponding public key is used. I ended up using sha256 hashing on the corresponding public key encoded as PSCK#8 DER.

Copy link
Member

@sandhose sandhose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants