myrsa

package
v0.0.0-...-eb6ee88 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const WITNESS_COUNT = 20

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrMessageTooLong

type ErrMessageTooLong struct{}

ErrMessageTooLong Error returned when attempting to encrypt a message which is too large for the public key.

func (ErrMessageTooLong) Error

func (e ErrMessageTooLong) Error() string

type PrivateKey

type PrivateKey struct {
	// Pointer to the public key which holds the modulus
	Public *PublicKey
	// contains filtered or unexported fields
}

func Keygen

func Keygen(keySize uint) *PrivateKey

RSA key genenerator

func ReadPrivateKey

func ReadPrivateKey(r io.Reader) *PrivateKey

func (*PrivateKey) Decrypt

func (private *PrivateKey) Decrypt(r io.Reader, w io.Writer)

func (*PrivateKey) Save

func (private *PrivateKey) Save(w io.Writer)

Save the private key to the writer

type PublicKey

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

func ReadPublicKey

func ReadPublicKey(r io.Reader) *PublicKey

func (*PublicKey) Encrypt

func (public *PublicKey) Encrypt(r io.Reader, w io.Writer)

func (*PublicKey) EncryptByByte

func (public *PublicKey) EncryptByByte(r io.Reader, w io.Writer)

func (*PublicKey) Save

func (public *PublicKey) Save(w io.Writer)

Jump to

Keyboard shortcuts

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