Neonatal Penguin March

    @ew-did-registry/keys
    TypeScript icon, indicating that this package has built-in type declarations

    0.6.0 • Public • Published

    Keys Package

    The keys package provides a clean and simple interface for the client and expose cryptographic operations based on asymmetric cryptography for secp256k1 ECDSA.

    // If you don't have a key pair you can generate new Key Pair
    const keys = Keys.generateKeyPair(); // builder
    
    // If you have a private key you can instantiate the Keys with private key
    const keys = new Keys({ privateKey: keys.privateKey });
    
    // If you have a public key you can Instantiate the Keys with public key
    const keys = new Keys({ publicKey: keys.publicKey });
    
    // Sign and verify data. 
    const data = "test";
    const signature = keys.sign(data); // Doesn't work if you initiate the Keys with public key.
    console.log(keys.verify(data, signature)); // true

    Install

    npm i @ew-did-registry/keys

    DownloadsWeekly Downloads

    702

    Version

    0.6.0

    License

    GPL-3.0-or-later

    Unpacked Size

    64.8 kB

    Total Files

    22

    Last publish

    Collaborators

    • energywebdev