@types/crypto-ld
TypeScript icon, indicating that this package has built-in type declarations

7.0.4 • Public • Published

Installation

npm install --save @types/crypto-ld

Summary

This package contains type definitions for crypto-ld (https://github.com/digitalbazaar/crypto-ld).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/crypto-ld.

index.d.ts

export class CryptoLD {
    constructor(params?: { suites: Map<string, unknown> });

    use(keyPairLib: LDKeyPair): void;

    generate(options?: { type: string; controller?: string }): Promise<LDKeyPair>;

    from(serialized: object): Promise<LDKeyPair>;

    fromKeyDocument({
        document,
        checkContext,
        checkRevoked,
    }: {
        document: object;
        checkContext: boolean;
        checkRevoked: boolean;
    }): Promise<LDKeyPair>;

    fromKeyId({
        id,
        documentLoader,
        checkContext,
        checkRevoked,
    }: {
        id: string;
        documentLoader: () => void;
        checkContext: boolean;
        checkRevoked: boolean;
    }): Promise<LDKeyPair>;
}

export class LDKeyPair {
    constructor({ id, controller, revoked }?: { id?: string; controller?: string; revoked?: string });

    static generate(/* options */): Promise<LDKeyPair>;

    static fromKeyDocument({
        document,
        checkContext,
        checkRevoked,
    }: {
        document: string;
        checkContext: boolean;
        checkRevoked: boolean;
    }): Promise<LDKeyPair>;

    static from(options?: object): Promise<LDKeyPair>;

    export({ publicKey, privateKey }: { publicKey: boolean; privateKey: boolean }): object;

    fingerprint(): string;

    verifyFingerprint({ fingerprint }: { fingerprint: string }): {
        verified: boolean;
    };

    signer(): { sign: ({ data }: { data: Uint8Array }) => Promise<string | Uint8Array> };

    verifier(): { verify: ({ data, signature }: { data: Uint8Array; signature: Uint8Array }) => Promise<boolean> };
}

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by behruzrahimov.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/crypto-ld

Weekly Downloads

127

Version

7.0.4

License

MIT

Unpacked Size

5.78 kB

Total Files

5

Last publish

Collaborators

  • types