PASERK is an extension to PASETO that provides key-wrapping and serialization.
PASERK supports the following purposes:
lid- Unique Identifier for a separate PASERK for local PASETOs.local- Symmetric key for local tokens.local_pw- Symmetric key wrapped using password-based encryption.local_wrap- Symmetric key wrapped by another symmetric key.pid- Unique Identifier for a separate PASERK for public PASETOs.public- Public key for verifying public tokens.seal- Symmetric key wrapped using asymmetric encryption.secret- Secret key for signing public tokens.secret_pw- Asymmetric secret key wrapped using password-based encryption.secret_wrap- Asymmetric secret key wrapped by another symmetric key.sid- Unique Identifier for a separate PASERK for public PASETOs.
A PASERK can be created like so:
iex> key = Pasexto.Key.new(:v4, :local)
iex> {:ok, paserk} = Pasexto.Paserk.build(:k4, :lid, key)
Summary
Functions
Returns a PASERK for the given kind, purpose and key.
Parses a PASERK for the given kind and purpose.
Types
Functions
Returns a PASERK for the given kind, purpose and key.
Some purposes require additional information to successfully build, these can be provided as options.
Options
password- A password for use with:local_pwand:secret_pw.public_key- A public key for use with:seal.- for
v1this must be a 4096-bit RSA public key. - for
v2this must be a Ed25519 public key. - for
v3this must be a P-384 public key. - for
v4this must be a Ed25519 public key.
- for
wrapper- APasexto.Wrapperfor use with:local_wrapand:secret_wrap.
In addition to the above options :local_pw and :secret_pw also accept the
following options for their key derivation functions:
iterations- defines how many iterations to perform, defaults to100_000. Versionsv1andv3only.memory_cost- defines how much memory to use in bytes, defaults to67_108_864. Versionsv2andv4only.parallelism_degree- defines the independent number of tasks, defaults to1. Versionsv2andv4only.time_cost- defines the execution time as a number of iterations, defaults to2. Versionsv2andv4only.
Parses a PASERK for the given kind and purpose.
Some purposes require additional information to successfully build, these can be provided as options.
Options
password- A password for use with:local_pwand:secret_pw.private_key- A private key for use with:seal.- for
v1this must be a 4096-bit RSA private key. - for
v2this must be a Ed25519 private key. - for
v3this must be a P-384 private key. - for
v4this must be a Ed25519 private key.
- for
wrapper- APasexto.Wrapperfor use with:local_wrapand:secret_wrap.
As :lid, :pid and :sid can only be serialised, trying to set this
purpose will raise an argument error.