kex

package
v0.0.0-...-af13ce4 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidKeyFormat = errors.New("invalid key format")

Functions

func GenerateKeyPair

func GenerateKeyPair() (crypto.PrivateKey, crypto.PublicKey, error)

func GenerateNonce

func GenerateNonce() ([]byte, error)

func SharedSecret

func SharedSecret(private crypto.PrivateKey, public crypto.PublicKey) ([]byte, error)

func Sign

func Sign(
	privateKey ssh.Signer,
	nonce []byte,
	serverEphPubKey []byte,
	clientEphPubKey []byte,
	sharedSecret []byte,
) ([]byte, error)

func Verify

func Verify(
	clientSignature []byte,
	nonce []byte,
	serverEphPubKey []byte,
	clientEphPubKey []byte,
	clientPublicKey ssh.PublicKey,
	sharedSecret []byte,
) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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