about summary refs log tree commit diff
path: root/src/tests.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2018-09-04T09·01+0200
committerVincent Ambo <mail@tazj.in>2018-09-04T10·45+0200
commit4b5dc17fc8320b32f6bfd9ab0fe435f67346871c (patch)
treeb33658b94f7466b72bbea099448d59f9e7629e8c /src/tests.rs
parent17e3a6560ac045fac56f354d40036264459cca44 (diff)
feat: Introduce validation of JWT signatures
Introduces the internal function for validating JWT signatures. The
process is relatively straightforward:

1. Create an OpenSSL signature verifier using the public key from the
   JWK.

2. Split the JWT into the data (header + claims) and signature parts.

3. Validate the data against the signature using the verifier from (1)

OpenSSL "cleanly" returns a boolean in case of an invalid signature,
but an otherwise successful operation.

This is represented differently in the returned error variant, with an
invalid signature being represented as `InvalidSignature`, and other
errors as the `OpenSSL` error variant which wraps the underlying
OpenSSL issue.

Successful validation returns an empty `Ok` result.
Diffstat (limited to 'src/tests.rs')
0 files changed, 0 insertions, 0 deletions