pub struct VerificationMethod {
pub id: String,
pub method_type: String,
pub controller: String,
pub public_key_jwk: Option<Value>,
pub public_key_multibase: Option<String>,
}Expand description
A DID document verification method entry.
Fields§
§id: String§method_type: String§controller: String§public_key_jwk: Option<Value>JWK public key representation.
public_key_multibase: Option<String>Multibase-encoded public key (z prefix = base58btc + multicodec).
Implementations§
Source§impl VerificationMethod
impl VerificationMethod
Sourcepub fn ed25519_public_key_bytes(&self) -> Result<[u8; 32], AcdpError>
pub fn ed25519_public_key_bytes(&self) -> Result<[u8; 32], AcdpError>
Extract the raw 32-byte Ed25519 public key.
Supports both publicKeyJwk (OKP / Ed25519) and
publicKeyMultibase (base58btc, multicodec 0xed01 prefix).
Sourcepub fn ecdsa_p256_public_key_sec1(&self) -> Result<Vec<u8>, AcdpError>
pub fn ecdsa_p256_public_key_sec1(&self) -> Result<Vec<u8>, AcdpError>
Extract the SEC1-uncompressed P-256 public key (65 bytes
starting with 0x04).
Sourcepub fn declared_algorithm(&self) -> Option<&'static str>
pub fn declared_algorithm(&self) -> Option<&'static str>
Best-effort algorithm declaration derived from the verification
method’s type and (when relevant) publicKeyJwk parameters.
Returns the canonical lowercase algorithm string compatible with
signature.algorithm (e.g. "ed25519", "ecdsa-p256"), or
None for verification methods whose declared algorithm cannot
be inferred from type alone.
Used by the high-level Verifier::verify_body to
detect algorithm-downgrade attacks per RFC-ACDP-0008 §3.9.
Trait Implementations§
Source§impl Clone for VerificationMethod
impl Clone for VerificationMethod
Source§fn clone(&self) -> VerificationMethod
fn clone(&self) -> VerificationMethod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more