josex

package
v0.0.577 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadJSONWebKey

func LoadJSONWebKey(json []byte, pub bool) (*jose.JSONWebKey, error)

LoadJSONWebKey returns a *jose.JSONWebKey for a given JSON string.

func LoadPrivateKey

func LoadPrivateKey(data []byte) (interface{}, error)

LoadPrivateKey loads a private key from PEM/DER/JWK-encoded data.

func LoadPublicKey

func LoadPublicKey(data []byte) (interface{}, error)

LoadPublicKey loads a public key from PEM/DER/JWK-encoded data.

func NewEncryptionKey added in v0.0.387

func NewEncryptionKey(alg jose.KeyAlgorithm, bits int) (crypto.PublicKey, crypto.PrivateKey, error)

NewEncryptionKey generates a keypair for corresponding KeyAlgorithm.

func NewSigningKey added in v0.0.387

func NewSigningKey(alg jose.SignatureAlgorithm, bits int) (crypto.PublicKey, crypto.PrivateKey, error)

NewSigningKey generates a keypair for corresponding SignatureAlgorithm.

func ToPublicKey added in v0.0.411

func ToPublicKey(k *jose.JSONWebKey) jose.JSONWebKey

ToPublicKey returns the public key of the given private key.

Types

type Base64Reader added in v0.0.387

type Base64Reader struct {
	In io.Reader
}

Base64Reader wraps an input stream consisting of either standard or url-safe base64 data, and maps it to a raw (unpadded) standard encoding. This can be used to read any base64-encoded data as input, whether padded, unpadded, standard or url-safe.

func (Base64Reader) Read added in v0.0.387

func (r Base64Reader) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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