core

package
v0.0.0-...-9f2da65 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func HashPassword

func HashPassword(password string) (string, error)

Types

type CryptoManager

type CryptoManager interface {
	GetBits() int

	CreatePubPriKey() (*rsa.PrivateKey, *rsa.PublicKey)
	PrivateKeyToBytes(pri *rsa.PrivateKey) []byte
	PublicKeyToBytes(pub *rsa.PublicKey) []byte
	BytesToPrivateKey(priv []byte) *rsa.PrivateKey
	BytesToPublicKey(pub []byte) *rsa.PublicKey
	EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) []byte
	DecryptWithPrivateKey(ciphertext []byte, priv *rsa.PrivateKey) []byte
}

func NewCryptoManager

func NewCryptoManager(bits int) CryptoManager

Jump to

Keyboard shortcuts

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