securemessage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package securemessage handles generation and use of one-shot asymmetric encrpyption keys used in LRPC messages

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPublicKey = errors.New("No public key")
)

common errors

Functions

func DecryptString

func DecryptString(ciphers []string, label string) (string, error)

DecryptString decrypts the slice of based64-encrypted strings into a single text string

func EncryptString

func EncryptString(payload string, label string, pubKey *rsa.PublicKey) ([]string, error)

EncryptString encrpyts the payload using the given public key. This is usually done by the LRPC client when it needs to send sensitive information (e.g., password) in LRPC message. A slice of base64-encoded strings is returned as this function need to chunk the input string into one or more blocks for encryption.

func GetPublicKey

func GetPublicKey() (*rsa.PublicKey, uint32, error)

GetPublicKey returns the public key for use in LRPC messages

Types

This section is empty.

Jump to

Keyboard shortcuts

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