Crypto React
    Preparing search index...

    Interface UseKeypairResult

    Return type of the useKeypair hook.

    const { publicKey, privateKey, generate, isGenerating }: UseKeypairResult = useKeypair();
    
    interface UseKeypairResult {
        publicKey: string | null;
        privateKey: string | null;
        algorithm: string | null;
        generate: (
            algorithm?:
                | "ed25519"
                | "x25519"
                | "ed448"
                | "x448"
                | "p256"
                | "p384"
                | "ml-kem-512"
                | "ml-kem-768"
                | "ml-kem-1024"
                | "ml-dsa-44"
                | "ml-dsa-65"
                | "ml-dsa-87",
        ) => void;
        isGenerating: boolean;
    }
    Index
    publicKey: string | null

    Hex-encoded public key, or null before generation.

    privateKey: string | null

    Hex-encoded private key, or null before generation.

    algorithm: string | null

    Algorithm used for the last generated pair.

    generate: (
        algorithm?:
            | "ed25519"
            | "x25519"
            | "ed448"
            | "x448"
            | "p256"
            | "p384"
            | "ml-kem-512"
            | "ml-kem-768"
            | "ml-kem-1024"
            | "ml-dsa-44"
            | "ml-dsa-65"
            | "ml-dsa-87",
    ) => void

    Generate a new key pair (optionally override the default algorithm).

    isGenerating: boolean

    True while a key pair is being generated.