I want to use a suitable libsodium keypair as user identity but I don't know yet what cryptography features I'll provide.
There seems to be 3 types of keypair generation in libsodium:
crypto_box_keypair()
crypto_kx_keypair()
crypto_sign_keypair()
Also, there seems to be 3 types of keys:
// Source: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/libsodium-wrappers/index.d.ts
export type KeyType = 'curve25519' | 'ed25519' | 'x25519';
I don't know which key-type corresponds to which key-pair generation function, or if they correspond at all.
So, the questions:
- Each key-pair is designed to be used with some functions (e.g.,
crypto_box_keypair()
withcrypto_box_easy()
). What is the compatibility matrix between the keypair types & the cryptographic functions/capabilities? - If there's a key-type that can be used with all functions, which one is it?