Skip to content
C implementation of PASETO (v2 tokens only)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
include
src
test
CMakeLists.txt
LICENSE
README.md
libsodium.LICENSE
paseto.pc.in

README.md

C library for PASETO

libpaseto is a low-level implementation of Platform-Agnostic Security Tokens in C. It only supports v2 public and private tokens, v1 is not supported. PASETO Registered Claims are not in the scope of this project but can be built ontop of libpaseto.

Building

libpaseto only depends on libsodium and uses CMake. It can be built using the following commands:

mkdir build
cd build
cmake ..
make
cd ..
build/pasetotest

Usage overview

  • Initialize the library: paseto_init
  • Load a key using paseto_v2_{local,public}_load_...
  • Encrypt or sign a message using paseto_v2_local_encrypt or paseto_v2_public_sign respectively
  • Decrypt or verify a token using paseto_v2_local_decrypt or paseto_v2_public_verify respectively. They will return the decoded message on success, a null pointer otherwise.
  • Clean up returned results using paseto_free

Refer to example.c for a detailed example.

License

libpaseto is published under the 3-clause BSD license and makes use of libsodium which is published under the ISC license.

You can’t perform that action at this time.