keys

package
v0.0.0-...-d357a17 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CryptoKey

type CryptoKey interface {
	Generate()
	ExportPrivateKey() string
	ExportPublicKey() string
	Export() (string, string)
	ImportPrivateKey(key string)
	ImportPublicKey(key string)
	Import(public string, private string)
	ExportPublicBase64() string
	ExportPrivateBase64() string
	ExportBase64() (string, string)
	ImportPublicBase64(key string)
	ImportPrivateBase64(key string)
	ImportBase64(public string, private string)
	ExportJWK() (string, error)
	Encrypt(data []byte) ([]byte, error)
	Decrypt(data []byte) ([]byte, error)
	Sign(data []byte) ([]byte, error)
	Verify(data []byte, signature []byte) bool
	EncryptString(data string) (string, error)
	DecryptString(data string) (string, error)
	SignString(data string) (string, error)
	VerifyString(data string, signature string) bool
}

type Rsa

type Rsa struct {
	PrivateKey *rsa.PrivateKey
	PublicKey  *rsa.PublicKey
}

func (*Rsa) CalculateJWK

func (r *Rsa) CalculateJWK() (res map[string]interface{}, er error)

func (*Rsa) Decrypt

func (r *Rsa) Decrypt(data []byte) ([]byte, error)

func (*Rsa) DecryptString

func (r *Rsa) DecryptString(data string) (string, error)

func (*Rsa) Encrypt

func (r *Rsa) Encrypt(data []byte) ([]byte, error)

func (*Rsa) EncryptString

func (r *Rsa) EncryptString(data string) (string, error)

func (*Rsa) Export

func (r *Rsa) Export() (string, string)

func (*Rsa) ExportBase64

func (r *Rsa) ExportBase64() (string, string)

func (*Rsa) ExportPrivateBase64

func (r *Rsa) ExportPrivateBase64() string

func (*Rsa) ExportPrivateKey

func (r *Rsa) ExportPrivateKey() string

func (*Rsa) ExportPublicBase64

func (r *Rsa) ExportPublicBase64() string

func (*Rsa) ExportPublicKey

func (r *Rsa) ExportPublicKey() string

func (*Rsa) Generate

func (r *Rsa) Generate(bits int) error

func (*Rsa) Import

func (r *Rsa) Import(public string, private string)

func (*Rsa) ImportBase64

func (r *Rsa) ImportBase64(public string, private string)

func (*Rsa) ImportPrivateBase64

func (r *Rsa) ImportPrivateBase64(key string)

func (*Rsa) ImportPrivateKey

func (r *Rsa) ImportPrivateKey(key string)

func (*Rsa) ImportPublicBase64

func (r *Rsa) ImportPublicBase64(key string)

func (*Rsa) ImportPublicKey

func (r *Rsa) ImportPublicKey(key string)

func (*Rsa) Sign

func (r *Rsa) Sign(data []byte) ([]byte, error)

func (*Rsa) SignString

func (r *Rsa) SignString(data string) (string, error)

func (*Rsa) Verify

func (r *Rsa) Verify(data []byte, signature []byte) bool

func (*Rsa) VerifyString

func (r *Rsa) VerifyString(data string, signature string) bool

Jump to

Keyboard shortcuts

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