mtls

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 11 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTLSConfig

func NewTLSConfig(privKey ed25519.PrivateKey, pubKeys []ed25519.PublicKey) (*tls.Config, error)

func NewTransportCredentials

func NewTransportCredentials(privKey ed25519.PrivateKey, pubKeys []ed25519.PublicKey) (credentials.TransportCredentials, error)

NewTransportCredentials creates a gRPC TransportCredentials from a PrivateKey and PublicKeys set.

func NewTransportSigner

func NewTransportSigner(signer crypto.Signer, pubKeys []ed25519.PublicKey) (credentials.TransportCredentials, error)

Types

type PrivateKey

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

func ValidPrivateKeyFromEd25519

func ValidPrivateKeyFromEd25519(key ed25519.PrivateKey) (*PrivateKey, error)

type PublicKeys

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

PublicKeys wraps a slice of keys so we can update the keys dynamically.

func ValidPublicKeysFromEd25519

func ValidPublicKeysFromEd25519(keys ...ed25519.PublicKey) (*PublicKeys, error)

func (*PublicKeys) Keys

func (r *PublicKeys) Keys() []ed25519.PublicKey

func (*PublicKeys) Replace

func (r *PublicKeys) Replace(pubs *PublicKeys)

Replace replaces the existing keys with new keys. Use this to dynamically update the allowable keys at runtime.

func (*PublicKeys) VerifyPeerCertificate

func (r *PublicKeys) VerifyPeerCertificate() func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error

Verifies that the certificate's public key matches with one of the keys in our list of registered keys.

type StaticSizedPublicKey

type StaticSizedPublicKey [ed25519.PublicKeySize]byte

func PubKeyFromCert

func PubKeyFromCert(cert *x509.Certificate) (StaticSizedPublicKey, error)

PubKeyFromCert extracts the public key from the cert and returns it as a statically sized byte array.

func ToStaticallySizedPublicKey

func ToStaticallySizedPublicKey(pubKey ed25519.PublicKey) (StaticSizedPublicKey, error)

ToStaticallySizedPublicKey converts an ed25519 public key into a statically sized byte array.

func (StaticSizedPublicKey) String

func (p StaticSizedPublicKey) String() string

Jump to

Keyboard shortcuts

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