Connecting to Klave
The SCP
class is the main entry point to Klave and provides a set of methods to connect to Klave,
manage the connection and interact with your Klave applications.
The connection api of the SCP
is the connect
method, which needs a url and
a cryptographic key. You can either import an existing key or create a new one through the Key
class.
Connecting to Klave
The default createKey
method uses the SubtleCrypto library to generate a cryptographic key with ECDSA algorithm and P-256 curve,
extractable and whose usages allow to sign and verify.
Connecting to Klave importing an existing key
Klave provides the method Context.get('sender')
to identify the key used for connection purposes. This allows you to whitelist a specific key in your Klave application.
To this end, we provide the exportKey
and importKey
methods for exporting and importing keys in clear text, and the seal
and exportEncryptedKey
methods for exporting and importing keys in encrypted format in the TypeScript connector.
The importKey
method assumes that the public and private key are in JWK format.