key

package
v0.0.52 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package key Code generated by go-bindata. (@generated) DO NOT EDIT. sources: migrations/sql/shared/.gitattributes migrations/sql/shared/.gitkeep migrations/sql/shared/sole_key.sql

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func CreateKey

func CreateKey(ctx context.Context, r Manager, g KeyGenerator, setId string) (*jose.JSONWebKeySet, error)

func FindKeyByPrefix

func FindKeyByPrefix(set *jose.JSONWebKeySet, prefix string) (key *jose.JSONWebKey, err error)

func FindKeysByPrefix

func FindKeysByPrefix(set *jose.JSONWebKeySet, prefix string) (*jose.JSONWebKeySet, error)

func FirstKey

func FirstKey(keys []jose.JSONWebKey) *jose.JSONWebKey

func Ider

func Ider(typ, id string) string

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func PEMBlockForKey

func PEMBlockForKey(key interface{}) (*pem.Block, error)

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type KeyGenerator

type KeyGenerator interface {
	Generate(id, use string) (*jose.JSONWebKeySet, error)
}

type Manager

type Manager interface {
	AddKey(ctx context.Context, setId string, key *jose.JSONWebKey) error

	AddKeySet(ctx context.Context, setId string, keys *jose.JSONWebKeySet) error

	GetKey(ctx context.Context, setId, keyId string) (*jose.JSONWebKeySet, error)

	GetKeySet(ctx context.Context, setId string) (*jose.JSONWebKeySet, error)

	DeleteKey(ctx context.Context, setId, keyId string) error

	DeleteKeySet(ctx context.Context, setId string) error
}

type MemoryManager

type MemoryManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewMemoryManager

func NewMemoryManager() *MemoryManager

func (*MemoryManager) AddKey

func (m *MemoryManager) AddKey(ctx context.Context, setId string, key *jose.JSONWebKey) error

func (*MemoryManager) AddKeySet

func (m *MemoryManager) AddKeySet(ctx context.Context, setId string, keys *jose.JSONWebKeySet) error

func (*MemoryManager) DeleteKey

func (m *MemoryManager) DeleteKey(ctx context.Context, setId, keyId string) error

func (*MemoryManager) DeleteKeySet

func (m *MemoryManager) DeleteKeySet(ctx context.Context, setId string) error

func (*MemoryManager) GetKey

func (m *MemoryManager) GetKey(ctx context.Context, setId, keyId string) (*jose.JSONWebKeySet, error)

func (*MemoryManager) GetKeySet

func (m *MemoryManager) GetKeySet(ctx context.Context, setId string) (*jose.JSONWebKeySet, error)

type Provider

type Provider interface {
	KeyCipher() *pasta.Pasta
}

type RS256Generator

type RS256Generator struct {
	KeyLength int
}

func (*RS256Generator) Generate

func (g *RS256Generator) Generate(id, use string) (*jose.JSONWebKeySet, error)

type SQLManager

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

func NewSQLManager

func NewSQLManager(db *sqlx.DB, provider Provider) *SQLManager

func (*SQLManager) AddKey

func (m *SQLManager) AddKey(ctx context.Context, setId string, key *jose.JSONWebKey) error

func (*SQLManager) AddKeySet

func (m *SQLManager) AddKeySet(ctx context.Context, setId string, keys *jose.JSONWebKeySet) error

func (*SQLManager) DeleteKey

func (m *SQLManager) DeleteKey(ctx context.Context, setId, keyId string) error

func (*SQLManager) DeleteKeySet

func (m *SQLManager) DeleteKeySet(ctx context.Context, setId string) error

func (*SQLManager) GetKey

func (m *SQLManager) GetKey(ctx context.Context, setId, keyId string) (*jose.JSONWebKeySet, error)

func (*SQLManager) GetKeySet

func (m *SQLManager) GetKeySet(ctx context.Context, setId string) (*jose.JSONWebKeySet, error)

func (*SQLManager) MigrateTableName

func (*SQLManager) MigrateTableName() string

Jump to

Keyboard shortcuts

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