Skip to main content

find_working_key

Function find_working_key 

Source
fn find_working_key<'a>(
    access: &'a [VaultAccess],
    keychain: &Keychain,
) -> Result<Option<&'a EncryptedEnvelope>, OnePasswordError>
Expand description

Finds a readable access entry whose vault key the keychain can already decrypt.

None means every readable entry names a key we do not hold, which is a vault the account can see but not open. A malformed envelope or an unsupported scheme is an error instead, so an unreadable format never passes for a missing key.