rsautils

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decryptor

type Decryptor interface {
	Decrypt(cipherText string) ([]byte, error)
}

Decryptor handles decrypting messages

func NewRSADecryptorKeyFromFile

func NewRSADecryptorKeyFromFile(privateKeyPath string) (Decryptor, error)

NewRSADecryptorKeyFromFile returns an RSA decryptor

func NewRSADecryptorKeyFromString

func NewRSADecryptorKeyFromString(privateKey string) (Decryptor, error)

type RSAPublicKey

type RSAPublicKey struct {
	*rsa.PublicKey
}

RSAPublicKey a struct to hold an RSA Public Key

func PublicKeyFromString

func PublicKeyFromString(pKey string) (*RSAPublicKey, error)

PublicKeyFromString returns an RSA public key object from a string

func (*RSAPublicKey) Encrypt

func (pk *RSAPublicKey) Encrypt(text string) (string, error)

Encrypt uses RSA Public key to encrypt data

Jump to

Keyboard shortcuts

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