ecies

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidKeyParameter Invalid Key Parameter
	ErrInvalidKeyParameter = errors.New("Invalid Key Parameter.")

	// ErrInvalidKeyGeneratorParameter Invalid Key Generator Parameter
	ErrInvalidKeyGeneratorParameter = errors.New("Invalid Key Generator Parameter.")
)

Functions

This section is empty.

Types

type AsymmetricCipher

type AsymmetricCipher interface {
	// Init initializes this cipher with the passed parameters
	Init(params AsymmetricCipherParameter) error

	// Process processes the byte array given in input
	Process(msg []byte) ([]byte, error)
}

KeyGenerator defines an asymmetric cipher

type AsymmetricCipherParameter

type AsymmetricCipherParameter interface {
	Parameter

	IsPublic() bool
}

AsymmetricKeyParameter is common interface to represent asymmetric cipher parameters

type CipherParameters

type CipherParameters interface {
	Parameter
}

CipherParameters is common interface to represent cipher parameters

type KeyGenerator

type KeyGenerator interface {
	Init(params KeyGeneratorParameter) error

	GenerateKey() (PrivateKey, error)
}

KeyGenerator defines a key generator

type KeyGeneratorParameter

type KeyGeneratorParameter interface {
	Parameter
}

KeyGeneratorParameter is common interface to represent key generation parameters

type KeySerializer

type KeySerializer interface {
	// ToBytes converts a key to bytes
	ToBytes(key interface{}) ([]byte, error)

	// ToBytes converts bytes to a key
	FromBytes([]byte) (interface{}, error)
}

KeySerializer defines a key serializer/deserializer

type Parameter

type Parameter interface {
	GetRand() io.Reader
}

Parameter is common interface for all the parameters

type PrivateKey

type PrivateKey interface {
	AsymmetricCipherParameter

	GetPublicKey() PublicKey
}

PrivateKey is common interface to represent private asymmetric cipher parameters

type PublicKey

type PublicKey interface {
	AsymmetricCipherParameter
}

PublicKey is common interface to represent public asymmetric cipher parameters

type SPI

type SPI interface {
	NewAsymmetricCipherFromPrivateKey(priv PrivateKey) (AsymmetricCipher, error)
	NewAsymmetricCipherFromPublicKey(pub PublicKey) (AsymmetricCipher, error)
	NewPrivateKey(rand io.Reader, params interface{}) (PrivateKey, error)
	NewPublicKey(rand io.Reader, params interface{}) (PublicKey, error)
	SerializePrivateKey(priv PrivateKey) ([]byte, error)
	DeserializePrivateKey(bytes []byte) (PrivateKey, error)
}

SPI is the ECIES Service Provider Interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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