encryptor

package module
v0.0.0-...-ba13e92 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 7 Imported by: 3

README

dupman/encryptor

GitHub go.mod Go version of a Go module Lint and Test FOSSA Status Quality Gate Status Maintainability Rating Reliability Rating Security Rating codecov Go Report Card

Requirements

  • Go (>=1.17)

Installation

Usage

Changelog

Please see CHANGELOG for details.

Authors

License

Copyright (c) 2022 dupman.
Released under the Apache-2.0 license.

FOSSA Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encryptor

type Encryptor interface {
	SetPrivateKey(string) error
	PrivateKey() string
	SetPublicKey(string) error
	PublicKey() (string, error)
	GenerateKeyPair() error
	Encrypt(string) (string, error)
	Decrypt(string) (string, error)
}

type RSAEncryptor

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

func NewRSAEncryptor

func NewRSAEncryptor() *RSAEncryptor

func (*RSAEncryptor) Decrypt

func (e *RSAEncryptor) Decrypt(encrypted string) (decrypted string, err error)

Decrypt decrypts data with given private key.

func (*RSAEncryptor) Encrypt

func (e *RSAEncryptor) Encrypt(text string) (encrypted string, err error)

Encrypt encrypts data with given public key.

func (*RSAEncryptor) GenerateKeyPair

func (e *RSAEncryptor) GenerateKeyPair() (err error)

GenerateKeyPair generates a new key pair.

func (*RSAEncryptor) PrivateKey

func (e *RSAEncryptor) PrivateKey() (privateKey string)

PrivateKey gets the Private Key value.

func (*RSAEncryptor) PublicKey

func (e *RSAEncryptor) PublicKey() (publicKey string, err error)

PublicKey gets the Public Key value.

func (*RSAEncryptor) SetPrivateKey

func (e *RSAEncryptor) SetPrivateKey(privateKey string) (err error)

SetPrivateKey sets the Private Key value.

func (*RSAEncryptor) SetPublicKey

func (e *RSAEncryptor) SetPublicKey(publicKey string) (err error)

SetPublicKey sets the Public Key value.

Jump to

Keyboard shortcuts

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