public

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(input []byte) (Key, error)
	FromEncoded(encoded string) (Key, error)
	ToBytes(key Key) []byte
	ToEncoded(key Key) string
	ToHash(key Key) (*hash.Hash, error)
}

Adapter represents a public key adapter

func NewAdapter

func NewAdapter() Adapter

NewAdapter returns a new encryption's public adapter

type Builder

type Builder interface {
	Create() Builder
	WithKey(key rsa.PublicKey) Builder
	Now() (Key, error)
}

Builder represents a publicKey builder

func NewBuilder

func NewBuilder() Builder

NewBuilder returns a new encryption's public builder

type Key

type Key interface {
	Key() rsa.PublicKey
	Encrypt(msg []byte) ([]byte, error)
}

Key represents an encryption public key

Jump to

Keyboard shortcuts

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