rsa

package
v0.0.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RSA

type RSA struct {
	PrivateKey *rsa.PrivateKey

	PublicKey *rsa.PublicKey

	Key []byte

	InputData []byte

	OutputData []byte

	Standard Standard

	Errors error
}

func (*RSA) GenerateKeyPair

func (s *RSA) GenerateKeyPair(bits int) *RSA

GenerateKeyPair set public key and private key for RSA struct.

func (*RSA) InputFromBase64String

func (s *RSA) InputFromBase64String(data string) *RSA

InputFromBase64String set input data from base64 string.

func (*RSA) InputFromBytes

func (s *RSA) InputFromBytes(data []byte) *RSA

InputFromBytes set input data from byte slice.

func (*RSA) InputFromHexString

func (s *RSA) InputFromHexString(data string) *RSA

InputFromHexString set input data from hex string.

func (*RSA) InputFromString

func (s *RSA) InputFromString(data string) *RSA

InputFromString set input data from string.

func (*RSA) PrivateKeyFromPEM

func (s *RSA) PrivateKeyFromPEM(data []byte) *RSA

PrivateKeyFromPEM gets private key from a PEM byte slice.

func (*RSA) ToBase64String

func (s *RSA) ToBase64String() (string, error)

ToBase64String output data with base64 string.

func (*RSA) ToBytes

func (s *RSA) ToBytes() ([]byte, error)

ToBytes output data with byte type.

func (*RSA) ToHexString

func (s *RSA) ToHexString() (string, error)

ToHexString output data with hex string.

func (*RSA) ToString

func (s *RSA) ToString() (string, error)

ToString output data with string type.

type Standard

type Standard uint8
const (
	PKCS1 Standard = 1 + iota
	PKCS8
)

Jump to

Keyboard shortcuts

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