Aster TypeScript 0.3.893
    Preparing search index...

    Variable SecretKeyConst

    SecretKey: {
        generate(): string;
        readFile(path: string): string | null;
        writeFile(path: string, key: KeyMaterial): void;
        loadOrGenerate(path: string): string;
        nodeId(key: KeyMaterial): NodeId;
    }

    Type Declaration

    • generate: function
      • A fresh random key (OS CSPRNG), as 64 hex characters.

        Returns string

    • readFile: function
      • Read a secret key file; null when missing, throws when malformed.

        Parameters

        • path: string

        Returns string | null

    • writeFile: function
      • Write a new secret key file (mode 0600, parent directories created). Refuses to overwrite an existing file.

        Parameters

        • path: string
        • key: KeyMaterial

        Returns void

    • loadOrGenerate: function
      • Load the key file at path, creating it with a fresh key if missing.

        Parameters

        • path: string

        Returns string

    • nodeId: function
      • The node id (public key) of key.

        Parameters

        • key: KeyMaterial

        Returns NodeId