Documentation ¶
Overview ¶
Package paserk contains implementations of [PASERK](https://github.com/paseto-standard/paserk), an extension to PASETO that allows for key sharing. These are not critical security-sensitive, so it's fine-ish to implement ourselves to avoid having to add one more dependency.
Index ¶
- Constants
- func PASERKPublicToPublicKey(encoded PASERKPublic) (ed25519.PublicKey, error)
- func PASERKSecretToPrivateKey(encoded PASERKSecret) (ed25519.PrivateKey, error)
- func PaserkGSAID(authority *api.GovalSigningAuthority) string
- func PaserkPID(pubkey ed25519.PublicKey) string
- func PaserkSID(privkey ed25519.PrivateKey) string
- type PASERKPublic
- type PASERKSecret
Constants ¶
const ( // PaserkPublicHeader is the header of a PASERK public key: // https://github.com/paseto-standard/paserk/blob/master/types/public.md PaserkPublicHeader = "k2.public." // PaserkSecretHeader is the header of a PASERK secret key: // https://github.com/paseto-standard/paserk/blob/master/types/secret.md PaserkSecretHeader = "k2.secret." // PaserkSIDHeader is the header of a PASERK sid: // https://github.com/paseto-standard/paserk/blob/master/types/sid.md PaserkSIDHeader = "k2.sid." // PaserkPIDHeader is the header of a PASERK pid: // https://github.com/paseto-standard/paserk/blob/master/types/sid.md PaserkPIDHeader = "k2.pid." // PaserkGSAIDHeader is the header of a PASERK [api.GovalSigningAuthority] id. This // is a replit extension to PASERK. PaserkGSAIDHeader = "k2.gsaid." )
Variables ¶
This section is empty.
Functions ¶
func PASERKPublicToPublicKey ¶
func PASERKPublicToPublicKey(encoded PASERKPublic) (ed25519.PublicKey, error)
PASERKPublicToPublicKey unwraps an ed25519.PublicKey from its PASERK representation.
func PASERKSecretToPrivateKey ¶
func PASERKSecretToPrivateKey(encoded PASERKSecret) (ed25519.PrivateKey, error)
PASERKSecretToPrivateKey unwraps an ed25519.PrivateKey from its PASERK representation.
func PaserkGSAID ¶
func PaserkGSAID(authority *api.GovalSigningAuthority) string
PaserkGSAID returns the PASERK ID of a api.GovalSigningAuthority. This is a Replit extension to PASERK.
func PaserkPID ¶
PaserkPID returns the PASERK ID of an ed25519.PublicKey: https://github.com/paseto-standard/paserk/blob/master/types/pid.md
func PaserkSID ¶
func PaserkSID(privkey ed25519.PrivateKey) string
PaserkSID returns the PASERK ID of an ed25519.PrivateKey: https://github.com/paseto-standard/paserk/blob/master/types/sid.md
Types ¶
type PASERKPublic ¶
type PASERKPublic string
PASERKPublic is the serialized version of an ed25519.PublicKey: https://github.com/paseto-standard/paserk/blob/master/types/public.md
func PublicKeyToPASERKPublic ¶
func PublicKeyToPASERKPublic(pubkey ed25519.PublicKey) PASERKPublic
PublicKeyToPASERKPublic wraps an ed25519.PublicKey into its PASERK representation.
type PASERKSecret ¶
type PASERKSecret string
PASERKSecret is the serialized version of an ed25519.PrivateKey: https://github.com/paseto-standard/paserk/blob/master/types/secret.md
func PrivateKeyToPASERKSecret ¶
func PrivateKeyToPASERKSecret(privkey ed25519.PrivateKey) PASERKSecret
PrivateKeyToPASERKSecret wraps an ed25519.PrivateKey into its PASERK representation.