Function curveKeyPair

  • Returns a new random key pair to be used with the CURVE security mechanism.

    To correctly connect two sockets with this mechanism:

    • Generate a client keypair with curveKeyPair().
    • Generate a server keypair with curveKeyPair().
      • Assign the private key on the server socket with curveSecretKey.
      • Assign the public key on the client socket with curveServerKey. The server does not need to know its own public key. Key distribution is not handled by the CURVE security mechanism.

    Returns

    An object with a publicKey and a secretKey property, each being a 40 character Z85-encoded string.

    Returns {
        publicKey: string;
        secretKey: string;
    }

    • publicKey: string
    • secretKey: string

Generated using TypeDoc