New creates a new kontrol instance with the given version and config instance, and the default kontrol handlers. Publickey is used for validating tokens and privateKey is used for signing tokens.

Public and private keys are RSA pem blocks that can be generated with the following command:

openssl genrsa -out testkey.pem 2048
openssl rsa -in testkey.pem -pubout > testkey_pub.pem

If you need to provide custom handlers in place of the default ones, use the following command instead:

NewWithoutHandlers(conf, version)

New is referenced in 1 repository