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 ¶
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 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
Click to show internal directories.
Click to hide internal directories.