View Source fernet (fernet v0.1.0)
Implements fernet token generation and verification.
See https://github.com/fernet/specLink to this section Summary
Functions
Decode a base64url encoded key.
Encode a key using base64url encoding format for interoperability
Encode a signing key and an encryption key using base64url encoding format for interoperability
Generate a pseudorandom 32 bytes key, and encode it with the proper base64url format for interoperability.
Generate a pseudorandom 32 bytes key.
Generate a token for the provided Message using the supplied Key.
Verify a token and extract the message
Link to this section Types
Specs
encoded_key() :: binary().
Specs
encoded_token() :: binary().
Specs
encryption_key() :: <<_:128>>.
Specs
key() :: <<_:256>>.
Specs
signing_key() :: <<_:128>>.
Link to this section Functions
Specs
decode_key(encoded_key()) -> key().
Specs
encode_key(key()) -> encoded_key().
Specs
encode_key(signing_key(), encryption_key()) -> encoded_key().
Specs
generate_encoded_key() -> encoded_key().
Specs
generate_key() -> key().
Specs
generate_token(iodata(), key()) -> encoded_token().
Specs
verify_and_decrypt_token(encoded_token(), key(), TTL :: integer() | infinity) -> {ok, binary()} | {error, atom()}.