crypts

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const BufferSize int = 4096
View Source
const HMACSize = sha256.Size
View Source
const IvSize int = 16

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptionBase

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

func NewEncryptionBase

func NewEncryptionBase() *EncryptionBase

func (*EncryptionBase) Decrypt

func (base *EncryptionBase) Decrypt(data []byte) ([]byte, error)

func (*EncryptionBase) DecryptFile

func (base *EncryptionBase) DecryptFile(filePathIn, filePathOut string) error

func (*EncryptionBase) DecryptRSA

func (base *EncryptionBase) DecryptRSA(secretMessage []byte) ([]byte, error)

func (*EncryptionBase) Encrypt

func (base *EncryptionBase) Encrypt(data []byte) ([]byte, error)

func (*EncryptionBase) EncryptFile

func (base *EncryptionBase) EncryptFile(filePathIn, filePathOut string) error

func (*EncryptionBase) EncryptRSA

func (base *EncryptionBase) EncryptRSA(secretMessage []byte) ([]byte, error)

func (*EncryptionBase) GenerateRSAKey

func (base *EncryptionBase) GenerateRSAKey(bitSize int) (rsaKey *Keys, err error)

func (*EncryptionBase) SetEncodeBase64

func (base *EncryptionBase) SetEncodeBase64(useEncode64 bool) *EncryptionBase

func (*EncryptionBase) SetPassphrase

func (base *EncryptionBase) SetPassphrase(passphrase string) *EncryptionBase

func (*EncryptionBase) SetRsaPrivateKey

func (base *EncryptionBase) SetRsaPrivateKey(key string) *EncryptionBase

func (*EncryptionBase) SetRsaPublicKey

func (base *EncryptionBase) SetRsaPublicKey(key string) *EncryptionBase

func (*EncryptionBase) SetSignPrivateKey

func (base *EncryptionBase) SetSignPrivateKey(key string) *EncryptionBase

func (*EncryptionBase) SetSignPublicKey

func (base *EncryptionBase) SetSignPublicKey(key string) *EncryptionBase

func (*EncryptionBase) SetUseRandomness

func (base *EncryptionBase) SetUseRandomness(useRandomness bool, keyRandom string) *EncryptionBase

func (*EncryptionBase) SignData

func (base *EncryptionBase) SignData(message string) (signature string, err error)

func (*EncryptionBase) VerifyData

func (base *EncryptionBase) VerifyData(message string, signature []byte) (isVerified bool, err error)

type Keys

type Keys struct {
	PrivateKey string // encode to base64 raw url encoding
	PublicKey  string // encode to base64 raw url encoding
}

Jump to

Keyboard shortcuts

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