Skip to content

How does SealedSecret know which encryption cert to use for unsealing a secret? #1191

Closed Answered by tewfik-ghariani
chinmaya-n asked this question in Q&A
Discussion options

You must be logged in to vote

At the moment, all possible private keys are being tried and there is a ToDo item to change that

// TODO(mkm): use the key fingerprint encoded in ciphertext (if present) instead of trying all the possible keys

func HybridDecrypt(rnd io.Reader, privKeys map[string]*rsa.PrivateKey, ciphertext, label []byte) ([]byte, error) {

That HybridDecrypt function is called by the Unseal fct:

plaintext, err := crypto.HybridDecrypt(rand.Reader, privKeys, valueBytes, label)

And the Unseal function is called after looping …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mkmik
Comment options

Answer selected by chinmaya-n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants