token

package
v0.0.0-...-723d337 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportRsaPrivateKeyAsPemStr

func ExportRsaPrivateKeyAsPemStr(privkey *rsa.PrivateKey) string

func ExportRsaPublicKeyAsPemStr

func ExportRsaPublicKeyAsPemStr(pubkey *rsa.PublicKey) (string, error)

func GenerateRsaKeyPair

func GenerateRsaKeyPair() (*rsa.PrivateKey, *rsa.PublicKey)

func GenerateRsaKeyPairIfNotExist

func GenerateRsaKeyPairIfNotExist(privKeyFile string, pubKeyFile string, keyDir string, save bool) (*rsa.PrivateKey, *rsa.PublicKey)

func ParseRsaPrivateKeyFromPemStr

func ParseRsaPrivateKeyFromPemStr(privPEM string) (*rsa.PrivateKey, error)

func ParseRsaPublicKeyFromPemStr

func ParseRsaPublicKeyFromPemStr(pubPEM string) (*rsa.PublicKey, error)

Types

type Signer

type Signer interface {
	// Sign a token and return the serialized cryptographic token.
	Sign(claims *jwt.Claims) (*string, error)
}

func NewSigner

func NewSigner(privKey *rsa.PrivateKey, pubKey *rsa.PublicKey) (Signer, error)

type Verifier

type Verifier interface {
	// Sign a token and return the serialized cryptographic token.
	Verify(token *string) (*jwt.Claims, error)
}

func NewVerifier

func NewVerifier(pubKey *rsa.PublicKey) (Verifier, error)

Jump to

Keyboard shortcuts

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