token

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package token is used to manage the creation and validation of the credentials used for authenthication.

Index

Constants

This section is empty.

Variables

View Source
var RSAPrivateKey = `` /* 1678-byte string literal not displayed */

RSAPrivateKey for signing JWT Tokens ssh-keygen -f alm_rsa

View Source
var RSAPublicKey = `` /* 450-byte string literal not displayed */

RSAPublicKey for verifying JWT Tokens openssl rsa -in alm_rsa -pubout -out alm_rsa.pub

Functions

func ParsePrivateKey

func ParsePrivateKey(key []byte) (*rsa.PrivateKey, error)

ParsePrivateKey parses a []byte representation of a private key into a rsa.PrivateKey instance

func ParsePublicKey

func ParsePublicKey(key []byte) (*rsa.PublicKey, error)

ParsePublicKey parses a []byte representation of a public key into a rsa.PublicKey instance

Types

type Manager

type Manager interface {
	Extract(string) (*account.Identity, error)
	Locate(ctx context.Context) (uuid.UUID, error)
	PublicKey() *rsa.PublicKey
}

Manager generate and find auth token information

func NewManager

func NewManager(publicKey *rsa.PublicKey) Manager

NewManager returns a new token Manager for handling tokens

func NewManagerWithPrivateKey

func NewManagerWithPrivateKey(privateKey *rsa.PrivateKey) Manager

NewManagerWithPrivateKey returns a new token Manager for handling creation of tokens with both private and pulic keys

Jump to

Keyboard shortcuts

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