package
0.53.1
Repository: https://github.com/shulhan/share.git
Documentation: pkg.go.dev

# Functions

Decrypt given a shared key and encrypted token, decrypt the token to get the message.
Encrypt given the shared key, encrypt the plain message and generate the "local" token with optional footer.
NewLocalMode create and initialize new LocalMode using shared key.
NewPublicMode create new PublicMode with our private key for signing outgoing token.
Sign given an Ed25519 secret key "sk", a message "m", and optional footer "f" (which defaults to empty string); sign the message "m" and generate the public token.
Verify given a public key "pk", a signed message "sm" (that has been decoded from base64), and optional footer "f" (also that has been decoded from base64 string); verify that the signature is valid for the message.

# Variables

DefaultTTL define the time-to-live of each token, by setting ExpiredAt to current time + DefaultTTL.

# Structs

JSONFooter define the optional metadata and data at the footer of the token that are not included in signature.
JSONToken define the metadata and data inside the token that are included to generate the signature.
Key define private and public key for public mode.
LocalMode implement the PASETO encrypt and decrypt using shared key.
PublicMode implement the PASETO public mode to signing and verifying data using private key and one or more shared public keys.
PublicToken contains the unpacked public token.