pub struct VerificationMethod {
pub id: String,
pub type_: VerificationMethodType,
pub controller: String,
pub public_key_multibase: Option<String>,
pub public_key_jwk: Option<Value>,
pub public_key_pem: Option<String>,
pub blockchain_account_id: Option<String>,
pub ethereum_address: Option<String>,
}Expand description
Verification Method for DIDs
Fields§
§id: StringThe verification method ID
type_: VerificationMethodTypeThe verification method type
controller: StringThe controller of this verification method
public_key_multibase: Option<String>Public key in Multibase format (preferred)
public_key_jwk: Option<Value>Public key in JWK format
public_key_pem: Option<String>Public key in PEM format
blockchain_account_id: Option<String>Blockchain account identifier
ethereum_address: Option<String>Ethereum address (for EcdsaSecp256k1RecoveryMethod2020)
Implementations§
Source§impl VerificationMethod
impl VerificationMethod
Sourcepub fn new_ed25519(
id: String,
controller: String,
public_key: &[u8; 32],
) -> Self
pub fn new_ed25519( id: String, controller: String, public_key: &[u8; 32], ) -> Self
Create a new Ed25519 verification method
Sourcepub fn new_x25519(id: String, controller: String, public_key: &[u8; 32]) -> Self
pub fn new_x25519(id: String, controller: String, public_key: &[u8; 32]) -> Self
Create a new X25519 key agreement method
Sourcepub fn new_ethereum(
id: String,
controller: String,
ethereum_address: String,
) -> Self
pub fn new_ethereum( id: String, controller: String, ethereum_address: String, ) -> Self
Create an Ethereum-style verification method
Sourcepub fn is_signing_method(&self) -> bool
pub fn is_signing_method(&self) -> bool
Check if this is a signing method
Sourcepub fn is_key_agreement_method(&self) -> bool
pub fn is_key_agreement_method(&self) -> bool
Check if this is a key agreement method
Trait Implementations§
Source§impl Clone for VerificationMethod
impl Clone for VerificationMethod
Source§fn clone(&self) -> VerificationMethod
fn clone(&self) -> VerificationMethod
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VerificationMethod
impl Debug for VerificationMethod
Source§impl Default for VerificationMethod
impl Default for VerificationMethod
Source§fn default() -> VerificationMethod
fn default() -> VerificationMethod
Returns the “default value” for a type. Read more
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
Source§impl From<VerificationMethod> for VerificationRelationship
impl From<VerificationMethod> for VerificationRelationship
Source§fn from(method: VerificationMethod) -> Self
fn from(method: VerificationMethod) -> Self
Converts to this type from the input type.
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