crv

package
v2.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeCrvPriv - identifier to be appended at the start of Bytes() to distinguish it as a Curve25519 private key
	TypeCrvPriv uint8 = 201

	// TypeCrvPub - identifier to be appended at the start of Bytes() to distinguish it as a Curve25519 public key
	TypeCrvPub uint8 = 202
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KX

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

func Generate

func Generate() (kx *KX, err error)

Generate - generates a new Curve25519 public/private key

func New

func New(kxBytes []byte) (kx *KX, err error)

New - returns new instnace of key exchange from given bytes

func (*KX) Bytes

func (kx *KX) Bytes() (bytes []byte, err error)

Bytes - returns bytes of the key

func (*KX) IsPrivateKey

func (kx *KX) IsPrivateKey() (p bool)

IsPrivateKey - returns if K is a private key instance

func (*KX) IsPublicKey

func (kx *KX) IsPublicKey() (p bool)

IsPublicKey - returns if K is a public key instance

func (*KX) KeyType

func (kx *KX) KeyType() (kxt shared.KeyXType)

KeyType - returns key type

func (*KX) Length added in v2.0.7

func (kx *KX) Length() (length int)

Length - returns length of the private or public key

func (*KX) PublicKey

func (kx *KX) PublicKey() (kxPub shared.KeyExchange)

PublicKey - returns instance of public key of type Key Exchange

func (*KX) PublicKeyInstance

func (kx *KX) PublicKeyInstance() (pubkey []byte)

PublicKeyInstance - returns actual instance of public key of type

func (*KX) SharedSecret

func (kx *KX) SharedSecret(kxPub2 shared.KeyExchange) (sharedsecret []byte, err error)

PublicKey - returns instance of public key of type Key Exchange

func (*KX) String

func (kx *KX) String() (str string)

String - returns JSON encoded string of the key

Jump to

Keyboard shortcuts

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