SecretKeyStorage

Trait SecretKeyStorage 

Source
pub trait SecretKeyStorage {
    // Required methods
    fn get_first_matching(
        &self,
        role: &SignatureRole,
        label_match: Option<&LabelMatch>,
    ) -> Option<&SecretKeyEntry>;
    fn get_all_matching(
        &self,
        role: &SignatureRole,
        label_match: Option<&LabelMatch>,
    ) -> Vec<&SecretKeyEntry>;
}
Expand description

Storage for secret keys

Any possible number of key storage systems may be used for key storage, but all of them must provide a way for the system to fetch a key matching the desired role.

Required Methods§

Source

fn get_first_matching( &self, role: &SignatureRole, label_match: Option<&LabelMatch>, ) -> Option<&SecretKeyEntry>

Get a key appropriate for signing with the given role and optional match criteria with LabelMatch enum.

If no key is found, this will return a None. In general, if multiple keys match, the implementation chooses the “best fit” and returns that key.

Source

fn get_all_matching( &self, role: &SignatureRole, label_match: Option<&LabelMatch>, ) -> Vec<&SecretKeyEntry>

Similar to get_first_matching, but returns all matches rather than just the best fit

Implementors§