keys

package
v0.0.0-...-b986fe3 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedAlgorithm = errors.New("unsupported algorithm")

Functions

This section is empty.

Types

type ECDSAKeypair

type ECDSAKeypair struct {
	ECDSAPublicKey
	ECDSAPrivateKey
}

func ECDSAKeypairFrom

func ECDSAKeypairFrom(
	id string,
	key ecdsa.PrivateKey,
	alg jose.SignatureAlgorithm,
) *ECDSAKeypair

func GenerateECDSAKeypair

func GenerateECDSAKeypair(alg jose.SignatureAlgorithm) (*ECDSAKeypair, error)

func GenerateECDSAKeypairWith

func GenerateECDSAKeypairWith(
	alg jose.SignatureAlgorithm,
	curve elliptic.Curve,
	rand io.Reader,
) (*ECDSAKeypair, error)

func (ECDSAKeypair) EncryptionKeyAlgorithm

func (k ECDSAKeypair) EncryptionKeyAlgorithm() jose.KeyAlgorithm

func (ECDSAKeypair) KeyID

func (k ECDSAKeypair) KeyID() string

func (ECDSAKeypair) SigningAlgorithm

func (k ECDSAKeypair) SigningAlgorithm() jose.SignatureAlgorithm

type ECDSAPrivateKey

type ECDSAPrivateKey struct {
	// contains filtered or unexported fields
}

func ECDSAPrivateKeyFrom

func ECDSAPrivateKeyFrom(
	id string,
	key ecdsa.PrivateKey,
	alg jose.SignatureAlgorithm,
) *ECDSAPrivateKey

func (ECDSAPrivateKey) EncryptionKeyAlgorithm

func (k ECDSAPrivateKey) EncryptionKeyAlgorithm() jose.KeyAlgorithm

func (ECDSAPrivateKey) KeyID

func (k ECDSAPrivateKey) KeyID() string

func (ECDSAPrivateKey) PrivateKey

func (k ECDSAPrivateKey) PrivateKey() any

func (ECDSAPrivateKey) SigningAlgorithm

func (k ECDSAPrivateKey) SigningAlgorithm() jose.SignatureAlgorithm

type ECDSAPublicKey

type ECDSAPublicKey struct {
	// contains filtered or unexported fields
}

func ECDSAPublicKeyFrom

func ECDSAPublicKeyFrom(
	id string,
	key ecdsa.PublicKey,
	alg jose.SignatureAlgorithm,
) *ECDSAPublicKey

func (ECDSAPublicKey) EncryptionKeyAlgorithm

func (k ECDSAPublicKey) EncryptionKeyAlgorithm() jose.KeyAlgorithm

func (ECDSAPublicKey) KeyID

func (k ECDSAPublicKey) KeyID() string

func (ECDSAPublicKey) PublicKey

func (k ECDSAPublicKey) PublicKey() any

func (ECDSAPublicKey) SigningAlgorithm

func (k ECDSAPublicKey) SigningAlgorithm() jose.SignatureAlgorithm

type Ed25519Keypair

type Ed25519Keypair struct {
	Ed25519PublicKey
	Ed25519PrivateKey
}

func GenerateEd25519Keypair

func GenerateEd25519Keypair() (*Ed25519Keypair, error)

func GenerateEd25519KeypairWith

func GenerateEd25519KeypairWith(rand io.Reader) (*Ed25519Keypair, error)

func (Ed25519Keypair) KeyID

func (k Ed25519Keypair) KeyID() string

func (Ed25519Keypair) SigningAlgorithm

func (k Ed25519Keypair) SigningAlgorithm() jose.SignatureAlgorithm

type Ed25519PrivateKey

type Ed25519PrivateKey struct {
	// contains filtered or unexported fields
}

func (Ed25519PrivateKey) KeyID

func (k Ed25519PrivateKey) KeyID() string

func (Ed25519PrivateKey) PrivateKey

func (k Ed25519PrivateKey) PrivateKey() any

func (Ed25519PrivateKey) SigningAlgorithm

func (k Ed25519PrivateKey) SigningAlgorithm() jose.SignatureAlgorithm

type Ed25519PublicKey

type Ed25519PublicKey struct {
	// contains filtered or unexported fields
}

func (Ed25519PublicKey) KeyID

func (k Ed25519PublicKey) KeyID() string

func (Ed25519PublicKey) PublicKey

func (k Ed25519PublicKey) PublicKey() any

func (Ed25519PublicKey) SigningAlgorithm

func (k Ed25519PublicKey) SigningAlgorithm() jose.SignatureAlgorithm

type RSAKeypair

type RSAKeypair struct {
	RSAPublicKey
	RSAPrivateKey
}

func GenerateRSAKeypair

func GenerateRSAKeypair(alg jose.SignatureAlgorithm, enc jose.KeyAlgorithm, bits int) (*RSAKeypair, error)

func GenerateRSAKeypairWith

func GenerateRSAKeypairWith(
	alg jose.SignatureAlgorithm,
	enc jose.KeyAlgorithm,
	bits int,
	rand io.Reader,
) (*RSAKeypair, error)

func RSAKeypairFrom

func RSAKeypairFrom(id string, key rsa.PrivateKey, alg jose.SignatureAlgorithm, enc jose.KeyAlgorithm) *RSAKeypair

func (RSAKeypair) EncryptionKeyAlgorithm

func (k RSAKeypair) EncryptionKeyAlgorithm() jose.KeyAlgorithm

func (RSAKeypair) KeyID

func (k RSAKeypair) KeyID() string

func (RSAKeypair) SigningAlgorithm

func (k RSAKeypair) SigningAlgorithm() jose.SignatureAlgorithm

type RSAPrivateKey

type RSAPrivateKey struct {
	// contains filtered or unexported fields
}

func RSAPrivateKeyFrom

func RSAPrivateKeyFrom(
	id string,
	key rsa.PrivateKey,
	alg jose.SignatureAlgorithm,
	enc jose.KeyAlgorithm,
) *RSAPrivateKey

func (RSAPrivateKey) EncryptionKeyAlgorithm

func (k RSAPrivateKey) EncryptionKeyAlgorithm() jose.KeyAlgorithm

func (RSAPrivateKey) KeyID

func (k RSAPrivateKey) KeyID() string

func (RSAPrivateKey) PrivateKey

func (k RSAPrivateKey) PrivateKey() any

func (RSAPrivateKey) SigningAlgorithm

func (k RSAPrivateKey) SigningAlgorithm() jose.SignatureAlgorithm

type RSAPublicKey

type RSAPublicKey struct {
	// contains filtered or unexported fields
}

func RSAPublicKeyFrom

func RSAPublicKeyFrom(id string, key rsa.PublicKey, alg jose.SignatureAlgorithm, enc jose.KeyAlgorithm) *RSAPublicKey

func (RSAPublicKey) EncryptionKeyAlgorithm

func (k RSAPublicKey) EncryptionKeyAlgorithm() jose.KeyAlgorithm

func (RSAPublicKey) KeyID

func (k RSAPublicKey) KeyID() string

func (RSAPublicKey) PublicKey

func (k RSAPublicKey) PublicKey() any

func (RSAPublicKey) SigningAlgorithm

func (k RSAPublicKey) SigningAlgorithm() jose.SignatureAlgorithm

Jump to

Keyboard shortcuts

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