Skip to main content

Crate solid_pod_rs_didkey

Crate solid_pod_rs_didkey 

Source
Expand description

§solid-pod-rs-didkey

did:key resolver and self-signed JWT verifier for solid-pod-rs. Supports Ed25519, P-256, and secp256k1 key types.

§Modules

  • diddid:key:z... multibase identifier encoding and decoding.
  • pubkey — Codec-aware public-key representation (DidKeyPubkey).
  • jwt — Self-signed compact JWT (JWS) verifier bound to a did:key.
  • verifierDidKeyVerifier implementing solid_pod_rs::SelfSignedVerifier.
  • errorDidKeyError covering parse, crypto, and JWT failures.

§Quick start

use solid_pod_rs_didkey::{decode_did_key, encode_did_key, verify_self_signed_jwt};

// Resolve a did:key identifier to its public key.
let did = "did:key:z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp";
let pubkey = decode_did_key(did).unwrap();

// Round-trip back to the canonical did:key string.
assert_eq!(encode_did_key(&pubkey), did);

§Spec references

§solid-pod-rs-didkey

W3C did:key (Ed25519 / P-256 / secp256k1) resolver and self-signed JWT verifier for solid-pod-rs.

§What it does

  • Parses and encodes did:key:z... multibase identifiers.
  • Resolves a did:key to a W3C DID Document with verification methods.
  • Verifies compact JWS tokens self-signed by an embedded did:key.
  • Implements solid_pod_rs::SelfSignedVerifier so it plugs into the core CidVerifier dispatcher.

§Supported key types

MulticodecAlgorithmJWS alg
0xedEd25519EdDSA
0x1200P-256ES256
0xe7secp256k1ES256K

§Quick start

use solid_pod_rs_didkey::{decode_did_key, encode_did_key, DidKeyPubkey};

let did = "did:key:z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp";
let pubkey = decode_did_key(did).unwrap();
let roundtrip = encode_did_key(&pubkey);
assert_eq!(roundtrip, did);

§Licence

AGPL-3.0-only

Re-exports§

pub use did::decode as decode_did_key;
pub use did::encode as encode_did_key;
pub use error::DidKeyError;
pub use jwt::verify_self_signed_jwt;
pub use jwt::VerifiedJwt;
pub use pubkey::DidKeyPubkey;
pub use verifier::DidKeyVerifier;

Modules§

did
did:key identifier encoding / decoding.
error
Error type for the did:key crate.
jwt
Self-signed JWT verification against an embedded did:key.
pubkey
Public-key representation for did:key.
verifier
solid_pod_rs::SelfSignedVerifier implementation for did:key.