shared

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key interface {
	Bytes() (bytes []byte, err error)
	String() (str string)
	PublicKey() (kPub Key, err error)
	PrivateKeyInstance() (privKey interface{})
	PublicKeyInstance() (pubKey interface{})
	IsPrivateKey() (p bool)
	IsPublicKey() (p bool)
	KeyType() (kt KeyType)
	Sign(hashed []byte) (signed []byte, err error)
	Verify(signed []byte, hashed []byte) (ok bool)
}

Key - interface for different types of asymetric keys

type KeyExchange

type KeyExchange interface {
	Bytes() (bytes []byte, err error)
	String() (str string)
	PublicKey() (kxPub KeyExchange)
	SharedSecret(kxPub KeyExchange) (sharedsecret []byte, err error)
	PublicKeyInstance() (pubKey []byte)
	IsPrivateKey() (p bool)
	IsPublicKey() (p bool)
	KeyType() (kxt KeyXType)
}

KeyExchange - interface for different types key exchange

type KeyType

type KeyType uint8 // new type to define key types to be generated
const (

	// RSA2048 - generate an RSA 2048 bit key
	RSA2048 KeyType = 1 + iota

	// RSA4096 - generate an RSA 4096 bit key
	RSA4096

	// RSA4096 - generate an RSA 4096 bit key
	RSA8192

	// ECDSA256 - generate an ECDSA 256 bit key
	ECDSA256

	// ECDSA384 - generate an ECDSA 384 bit key
	ECDSA384

	// ECDSA521 - generate an ECDSA 512 bit key
	ECDSA521

	// ED25519 - generates an ED25519 256 bit key
	ED25519
)

func (KeyType) String

func (kt KeyType) String() (str string)

String - returns string name for a given key type

type KeyXType

type KeyXType uint8 // new type to define key exchanges to be generated
const (
	// CURVE25519 - generates a Curve25519 key exchange
	CURVE25519 KeyXType = iota + 101

	// ECDH256 - generates a EC Diffie-Hellman 256-bit key exchange
	ECDH256

	// ECDH384 - generates a EC Diffie-Hellman 384-bit key exchange
	ECDH384

	// ECDH521 - generates a EC Diffie-Hellman 521-bit key exchange
	ECDH521
)

func (KeyXType) String

func (kx KeyXType) String() (str string)

String - returns string name for a given key exchange type

Jump to

Keyboard shortcuts

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