keyutil

package
v0.0.0-...-ccd4941 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package keyutil provides utility functions for dealing with keys used by the JOSE package for JWT, JWS, JWE, and JWK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewECDSAKeyPair

func NewECDSAKeyPair() (*ecdsa.PublicKey, *ecdsa.PrivateKey, error)

func NewEdDSAKeyPair

func NewEdDSAKeyPair() (ed25519.PublicKey, ed25519.PrivateKey, error)

func NewRSAKeyPair

func NewRSAKeyPair() (*rsa.PublicKey, *rsa.PrivateKey, error)

func NewSymmetricKey

func NewSymmetricKey(size int) ([]byte, error)

NewSymmetricKey generates a new symmetric key of the given size.

func ParseECDSAPrivateKey

func ParseECDSAPrivateKey(r io.Reader) (*ecdsa.PrivateKey, error)

ParseECDSAPrivateKey parses the PEM encoded ECDSA private key from the given reader.

func ParseECDSAPublicKey

func ParseECDSAPublicKey(r io.Reader) (*ecdsa.PublicKey, error)

ParseECDSAPublicKey parses the PEM encoded ECDSA public key from the given reader.

func ParseEdDSAPrivateKey

func ParseEdDSAPrivateKey(r io.Reader) (ed25519.PrivateKey, error)

func ParseEdDSAPublicKey

func ParseEdDSAPublicKey(r io.Reader) (ed25519.PublicKey, error)

func ParsePrivateKey

func ParsePrivateKey(r io.Reader) (interface{}, error)

func ParsePublicKey

func ParsePublicKey(r io.Reader) (interface{}, error)

func ParseRSAPrivateKey

func ParseRSAPrivateKey(r io.Reader) (*rsa.PrivateKey, error)

ParseRSAPrivateKey parses the PEM encoded RSA private key from the given reader.

func ParseRSAPublicKey

func ParseRSAPublicKey(r io.Reader) (*rsa.PublicKey, error)

ParseRSAPublicKey parses the PEM encoded RSA public key from the given reader.

func SymmetricKeysEqual

func SymmetricKeysEqual(key1 []byte, key2 []byte) bool

SymmetricKeysEqual checks if the given keys are the same.

Types

This section is empty.

Jump to

Keyboard shortcuts

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