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§
Sourcefn get_first_matching(
&self,
role: &SignatureRole,
label_match: Option<&LabelMatch>,
) -> Option<&SecretKeyEntry>
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.
Sourcefn get_all_matching(
&self,
role: &SignatureRole,
label_match: Option<&LabelMatch>,
) -> Vec<&SecretKeyEntry>
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