Trait ddoresolver_rs::DdoParser
source · [−]pub trait DdoParser {
fn find_key_agreement(&self, pattern: &str) -> Option<KeyAgreement>;
fn find_public_key_for_curve(&self, curve: &str) -> Option<Vec<u8>>;
fn find_public_key_id_for_curve(&self, curve: &str) -> Option<String>;
fn find_public_key_controller_for_curve(
&self,
curve: &str
) -> Option<String>;
}
Expand description
Universal trait for DID document parser methods.
Provides method signatures to search through the document for particular elements or public crypto material.
Required Methods
fn find_key_agreement(&self, pattern: &str) -> Option<KeyAgreement>
fn find_key_agreement(&self, pattern: &str) -> Option<KeyAgreement>
Pattern finding method to resolve KeyAgreement
based on provided
pattern
. Returns None
if no matching result found instead of error.
Searches all crypto matherial in the document for particular curve and
returns FIRST! match for particular curve
, which can be partial pattern.
Returns None
if no matching result found instead of error.
fn find_public_key_id_for_curve(&self, curve: &str) -> Option<String>
fn find_public_key_id_for_curve(&self, curve: &str) -> Option<String>
Method similar to find_key_agreement
, but returns key ID
instead of the
key itself.
Returns None
if no matching result found instead of error.
fn find_public_key_controller_for_curve(&self, curve: &str) -> Option<String>
fn find_public_key_controller_for_curve(&self, curve: &str) -> Option<String>
Resolve controller for specified curve if it’s present in VerificationMethod
s list
Returns None
if no matching curve found.