paserk

package
v0.0.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 7 Imported by: 0

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

View Source
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.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL