Crypto Vue
    Preparing search index...

    Interface UseKeypairReturn

    Reactive state and methods returned by useKeypair.

    const state: UseKeypairReturn = useKeypair();
    await state.generate("ed25519");
    console.log(state.publicKey.value);
    interface UseKeypairReturn {
        publicKey: DeepReadonly<Ref<string | null>>;
        privateKey: DeepReadonly<Ref<string | null>>;
        algorithm: DeepReadonly<Ref<KeyAlgorithm | null>>;
        isGenerating: DeepReadonly<Ref<boolean>>;
        error: DeepReadonly<Ref<Error | null>>;
        generate: (
            algo:
                | "ed25519"
                | "x25519"
                | "ed448"
                | "x448"
                | "p256"
                | "p384"
                | "ml-kem-512"
                | "ml-kem-768"
                | "ml-kem-1024"
                | "ml-dsa-44"
                | "ml-dsa-65"
                | "ml-dsa-87",
        ) => Promise<GeneratedKeyPair>;
        clear: () => void;
    }
    Index
    publicKey: DeepReadonly<Ref<string | null>>

    Hex-encoded public key.

    privateKey: DeepReadonly<Ref<string | null>>

    Hex-encoded private key.

    algorithm: DeepReadonly<Ref<KeyAlgorithm | null>>

    Algorithm used for the last generation.

    isGenerating: DeepReadonly<Ref<boolean>>

    Whether a key generation is currently in progress.

    error: DeepReadonly<Ref<Error | null>>

    Error from the last generation attempt, if any.

    generate: (
        algo:
            | "ed25519"
            | "x25519"
            | "ed448"
            | "x448"
            | "p256"
            | "p384"
            | "ml-kem-512"
            | "ml-kem-768"
            | "ml-kem-1024"
            | "ml-dsa-44"
            | "ml-dsa-65"
            | "ml-dsa-87",
    ) => Promise<GeneratedKeyPair>

    Generate a new key pair for the given algorithm.

    clear: () => void

    Clear all reactive state.