principal

package
v0.0.0-...-9ccd474 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LocalID = &ID{s: string(TypeLocal)}

Functions

func ContextWithID

func ContextWithID(ctx context.Context, id *ID) context.Context

Types

type ID

type ID struct {
	// contains filtered or unexported fields
}

func ContextID

func ContextID(ctx context.Context) *ID

func ParseID

func ParseID(s string) (*ID, error)

func (*ID) PublicKey

func (id *ID) PublicKey() string

PublicKey associated with the ID. Panics if there isn't one.

If the ID type is ed25519, a base64url-encoded public key is returned.

func (*ID) String

func (id *ID) String() string

func (*ID) Type

func (id *ID) Type() Type

type Key

type Key struct {
	// contains filtered or unexported fields
}

func ParseEd25519Key

func ParseEd25519Key(encodedKey string) (pri *Key, err error)

func (*Key) PrincipalID

func (pri *Key) PrincipalID() *ID

func (*Key) PublicKey

func (pri *Key) PublicKey() ed25519.PublicKey

type RawKey

type RawKey [keySize]byte

func Raw

func Raw(id *ID) RawKey

type Type

type Type string
const (
	TypeLocal   Type = "local"
	TypeEd25519      = "ed25519"
)

func Split

func Split(id *ID) (Type, string)

Jump to

Keyboard shortcuts

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