jws

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSigner

func GetSigner(alg model.Algorithm, opts *model.Opts) (model.Signer, error)

GetSigner

Returns a Signer implementation for the given algorithm complete with generated keypair

alg - Determines which signer type gets returned

opts - Extra options object to control additional algorithm specific behaviour. BitSize determines the size of key to be returned for RSA keys - if none specified defaults to 2048. SecretKey is used to define a secret key value for HMAC algorithms

func GetSignerFromPrivateKey

func GetSignerFromPrivateKey(alg model.Algorithm, privateKey crypto.PrivateKey) (model.Signer, error)

GetSignerFromPrivateKey

Returns a Signer implementation for the given algorithm and private key

alg - Determines which signer type gets returned

privateKey - The provided `crypto.PrivateKey` implementation. Must be a pointer to the relevant key type for the selected algorithm

func GetValidator

func GetValidator(alg model.Algorithm, publicKey crypto.PublicKey) (model.Validator, error)

GetValidator

Returns a Validator implementation for the given algorithm and public key

alg - Determines which validator type gets returned

publicKey - `crypto.PublicKey` implementation to be used by the validator

func GetValidatorFromJwk

func GetValidatorFromJwk(alg model.Algorithm, jwk []byte) (model.Validator, error)

GetValidatorFromJwk

Returns a Validator implementation for the given algorithm and jwk-format public key

alg - Determines which validator type gets returned

jwk - jwk format public key

Types

This section is empty.

Jump to

Keyboard shortcuts

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