@li0ard/aspe - v0.1.2
    Preparing search index...

    @li0ard/aspe - v0.1.2

    aspe logo

    @li0ard/aspe
    simple library for Ariadne Signature Profile (ASP)
    docs




    • Simple: Hides decoding process and provides simple and modern API
    • Type-Safe: Most of the APIs are strictly typed to help your workflow
    • Compliance: Fully complies with Ariadne Signature Profile v0
    • Supports Bun, Node.js, Deno, Browsers, Cloudflare Workers
    • Supports ES256 and EdDSA (ED25519) keypairs and profile/request JWS
    # from NPM
    npm i @li0ard/aspe

    # from JSR
    bunx jsr add @li0ard/aspe
    import { ASPProfile, SecretKey, KeyType } from "@li0ard/aspe";

    const key = SecretKey.generate(KeyType.ES256);
    const profile = new ASPProfile(
    key.keyType,
    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!@#$%"));