rsa

package
v0.0.0-...-dc048c8 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(privateKey, ciphertext []byte) ([]byte, error)

func Encrypt

func Encrypt(publicKey, origData []byte) ([]byte, error)

Encrypt encrypts the given message with RSA-OAEP. Need a DER encoded public key, These values are typically found in PEM blocks with "BEGIN PUBLIC KEY".

func EncryptByCert

func EncryptByCert(pemCertificate, origData []byte) ([]byte, error)

func OAEPPDecrypt

func OAEPPDecrypt(pub, pri string, ciphertext []byte) ([]byte, error)

RSA/ECB/OAEPPadding

Types

type FileReader

type FileReader struct {
	FileName string
}

func (FileReader) ReadPem

func (f FileReader) ReadPem() ([]byte, error)

type Reader

type Reader interface {
	ReadPem() ([]byte, error)
}

type TextReader

type TextReader struct {
	Pem []byte
}

func (TextReader) ReadPem

func (t TextReader) ReadPem() ([]byte, error)

Jump to

Keyboard shortcuts

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