rsa

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Overview

Package rsa provides RSA encryption and decryption, signature and verification functions.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDataToLarge .
	ErrDataToLarge = errors.New("message too long for RSA public key size")
	// ErrDataLen .
	ErrDataLen = errors.New("data length error")
	// ErrDataBroken .
	ErrDataBroken = errors.New("data broken, first byte is not zero")
	// ErrKeyPairDisMatch .
	ErrKeyPairDisMatch = errors.New("data is not encrypted by the private key")
	// ErrDecryption .
	ErrDecryption = errors.New("decryption error")
	// ErrPublicKey .
	ErrPublicKey = errors.New("get public key error")
	// ErrPrivateKey .
	ErrPrivateKey = errors.New("get private key error")
)

Functions

func NewRSACrypt

func NewRSACrypt(secretInfo SecretInfo) *rsaCrypt

NewRSACrypt init with the RSA secret info

Types

type SecretInfo added in v1.1.0

type SecretInfo struct {
	PublicKey          string
	PublicKeyDataType  gocrypto.Encode
	PrivateKey         string
	PrivateKeyDataType gocrypto.Encode
	PrivateKeyType     gocrypto.Secret
	HashType           gocrypto.Hash
}

SecretInfo secret info

Jump to

Keyboard shortcuts

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