@li0ard/aspe
simple library for Ariadne Signature Profile (ASP)
- Simple: Hides decoding process and provides simple and modern API
- Type-Safe: Most of the APIs are strictly typed to help your workflow
- Compliance: Complies with Ariadne Signature Profile v0
- Supports Bun, Node.js, Deno, Browsers, Cloudflare Workers
- Supports ES256 lightweight keypairs and profile/request JWS
# from NPM
npm i @li0ard/aspe
# from JSR
bunx jsr add @li0ard/aspe import { ASPProfile, SecretKey } from "@li0ard/aspe";
const key = SecretKey.generate();
const profile = new ASPProfile(
key.publicKey,
"Alice",
"Hello, B0b",
["dns:domain.tld?type=txt", "https://domain.tld/@alice"],
"#6855c3"
);
profile.sign(key);
console.log(`New profile: ${profile.name} with ${profile.claims.length} claims`);
console.log(`Thumbprint: ${profile.thumbprint}`);
console.log(`Avatar URL: ${profile.getAvatarUrl()}`);
console.log(`Direct proof: ${profile.getURI()}`);
console.log(`Hashed proof: ${await profile.getHashedProof()}`);import { ASPProfile } from "@li0ard/aspe";
const base64 = `eyJ0eX....UdqxQ`;
const profile = ASPProfile.fromBase64(base64);
console.log(`Imported profile: ${profile.name}`);
console.log(`- Description: ${profile.description}`);
console.log(`- Claims: ${profile.claims.join(", ")}`);
console.log(`- Color: ${profile.color}`);import { SecretKey } from "@li0ard/aspe";
const secretKey = await SecretKey.fromBase64("ey....n0=", "MYCOOLPASSWORD");
console.log(secretKey);
console.log(await secretKey.toBase64("MYSTRONGESTPASSWORD123!@#$%"));