asymetric

package
v0.0.0-...-8654c45 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2014 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PublicKeyEncryptor

type PublicKeyEncryptor interface {
	Encrypt(data []byte) ([]byte, error)
}

func GetPublicKeyEncryptor

func GetPublicKeyEncryptor(contract_ *contract.AcceptedContract) (PublicKeyEncryptor, error)

type RsaOaepEncrypter

type RsaOaepEncrypter struct {
	PrivateKey *rsa.PrivateKey
	PublicKey  *rsa.PublicKey
	Hash       crypto.Hash

	Random io.Reader
}

func (*RsaOaepEncrypter) Decrypt

func (this *RsaOaepEncrypter) Decrypt(ciphertext []byte) ([]byte, error)

func (*RsaOaepEncrypter) Encrypt

func (this *RsaOaepEncrypter) Encrypt(data []byte) ([]byte, error)

type RsaPssSigner

type RsaPssSigner struct {
	PrivateKey *rsa.PrivateKey
	PublicKey  *rsa.PublicKey
	Hash       crypto.Hash

	Random io.Reader
}

func (*RsaPssSigner) Sign

func (this *RsaPssSigner) Sign(hashedData []byte) ([]byte, error)

func (*RsaPssSigner) VerifySignature

func (this *RsaPssSigner) VerifySignature(hashedData []byte, signature []byte) error

type Signer

type Signer interface {
	Sign(data []byte) ([]byte, error)
}

func GetSigner

func GetSigner(contract_ *contract.AcceptedContract) (Signer, error)

Jump to

Keyboard shortcuts

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