pub struct VerificationMethod {
pub id: String,
pub method_type: String,
pub controller: String,
pub public_key_multibase: String,
}Expand description
An Ed25519 verification method as defined in OAS Identity Documents.
See OAS Specification §5.1 for the complete structure.
§Examples
use oas_document::verification_method::VerificationMethod;
let vm = VerificationMethod {
id: "did:oas:acme:hmr:alice#key-1".to_string(),
method_type: "Ed25519VerificationKey2020".to_string(),
controller: "did:oas:acme:hmr:alice".to_string(),
public_key_multibase: "z6Mktest123".to_string(),
};
assert_eq!(vm.key_id(), "key-1");Fields§
§id: StringThe full key ID (e.g., did:oas:acme:hmr:alice#key-1).
method_type: StringThe verification method type. MUST be Ed25519VerificationKey2020.
controller: StringThe DID that controls this key.
public_key_multibase: StringThe public key encoded as multibase base58btc (with z prefix).
Implementations§
Source§impl VerificationMethod
impl VerificationMethod
Sourcepub fn key_id(&self) -> &str
pub fn key_id(&self) -> &str
Extracts the key fragment (the part after #) from the ID.
§Returns
The key fragment, or the full ID if no # is present.
§Examples
use oas_document::verification_method::VerificationMethod;
let vm = VerificationMethod {
id: "did:oas:ns:hmr:a#key-1".to_string(),
method_type: "Ed25519VerificationKey2020".to_string(),
controller: "did:oas:ns:hmr:a".to_string(),
public_key_multibase: "zTest".to_string(),
};
assert_eq!(vm.key_id(), "key-1");Trait Implementations§
Source§impl Clone for VerificationMethod
impl Clone for VerificationMethod
Source§impl Debug for VerificationMethod
impl Debug for VerificationMethod
Source§impl<'de> Deserialize<'de> for VerificationMethod
impl<'de> Deserialize<'de> for VerificationMethod
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for VerificationMethod
Source§impl PartialEq for VerificationMethod
impl PartialEq for VerificationMethod
Source§impl Serialize for VerificationMethod
impl Serialize for VerificationMethod
impl StructuralPartialEq for VerificationMethod
Auto Trait Implementations§
impl Freeze for VerificationMethod
impl RefUnwindSafe for VerificationMethod
impl Send for VerificationMethod
impl Sync for VerificationMethod
impl Unpin for VerificationMethod
impl UnsafeUnpin for VerificationMethod
impl UnwindSafe for VerificationMethod
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more