asx

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PrivateKeyLength is the allowed length of the private key
	PrivateKeyLength = kyb.PrivateKeyLength
	// MinPublicKeyLength is the minimum length allowed for the public key
	MinPublicKeyLength = ecc.KeyLength + 1

	// Algorithm Types
	AlgoECC   uint8 = 0
	AlgoKyber uint8 = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PrivateKey

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

PrivateKey represents a private key.

func NewPrivateKey

func NewPrivateKey() (*PrivateKey, error)

NewPrivateKey generates a new random private key.

func ParsePrivateKey

func ParsePrivateKey(key []byte) (*PrivateKey, error)

ParsePrivateKey returns the instance private key for given bytes. Please use exactly 64 bytes.

func (*PrivateKey) Bytes

func (privateKey *PrivateKey) Bytes() []byte

Bytes returns the bytes of the private key.

func (*PrivateKey) NewDecryptingReader

func (privateKey *PrivateKey) NewDecryptingReader(src io.Reader) (io.ReadCloser, error)

NewDecryptingReader returns a new ReadCloser that reads and decrypts data with the private key from src.

func (*PrivateKey) PublicKeyECC

func (privateKey *PrivateKey) PublicKeyECC() (*PublicKey, error)

PublicKey returns the ecc public key corresponding to the private key. The public key is derived from the private key.

func (*PrivateKey) PublicKeyKyber

func (privateKey *PrivateKey) PublicKeyKyber() (*PublicKey, error)

PublicKey returns the kyber public key corresponding to the private key. The public key is derived from the private key.

type PublicKey

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

PublicKey represents a public key.

func ParsePublicKey

func ParsePublicKey(key []byte) (*PublicKey, error)

GetPublicKey returns the instance of public key for given bytes.

func (*PublicKey) Bytes

func (publicKey *PublicKey) Bytes() ([]byte, error)

Bytes returns the public key as bytes.

func (*PublicKey) NewEncryptingWriter

func (publicKey *PublicKey) NewEncryptingWriter(dst io.Writer, compression bool) (io.WriteCloser, error)

NewEncryptingWriter returns a new WriteCloser that encrypts data with the public key and writes to dst.

Jump to

Keyboard shortcuts

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