encryption

package
v0.0.0-...-e95280a Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	FromBytes(bytes []byte) (PrivateKey, error)
	FromEncoded(encoded string) (PrivateKey, error)
	ToBytes(pk PrivateKey) []byte
	ToEncoded(pk PrivateKey) string
}

Adapter represents a privateKey adapter

func NewAdapter

func NewAdapter() Adapter

NewAdapter returns a new encryption's privatekey adapter

type Builder

type Builder interface {
	Create() Builder
	WithPK(pk rsa.PrivateKey) Builder
	Now() (PrivateKey, error)
}

Builder represents a privateKey builder

func NewBuilder

func NewBuilder() Builder

NewBuilder returns a new encryption's privatekey builder

type Factory

type Factory interface {
	Create() (PrivateKey, error)
}

Factory represents a privateKey factory

func NewFactory

func NewFactory(bitrate int) Factory

NewFactory returns a new encryption's privatekey factory

type PrivateKey

type PrivateKey interface {
	Key() rsa.PrivateKey
	Public() public.Key
	Decrypt(cipher []byte) ([]byte, error)
}

PrivateKey represents an encryption private key

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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