Documentation ¶
Index ¶
- Variables
- func Combine(shares []*Share) []byte
- func Decrypt(keyStore KeyStore, cipherText []byte, shares *pb.Shares) (io.Reader, error)
- func DecryptSharesAndCombine(keyStore KeyStore, shares *pb.Shares) ([]byte, error)
- func EncryptPrivateShare(e Encryptor, p Participant, serializedShare []byte) (*pb.PrivateShare, error)
- func LoadX509Certificate(certFile string) (*x509.Certificate, error)
- func SplitAndEncrypt(key []byte, encryptor Encryptor, participants []Participant, ...) (*pb.Shares, error)
- type EncryptionResult
- type EncryptionScheme
- type Encryptor
- type KeyStore
- type MemoryKeyStore
- type Participant
- type Share
- type TLSEncryptor
- type X509Participant
Constants ¶
This section is empty.
Variables ¶
View Source
var PGPMessageType = "PGP MESSAGE"
View Source
var ParticipantNotFound = errors.New("participant not found")
Functions ¶
func DecryptSharesAndCombine ¶
func EncryptPrivateShare ¶
func EncryptPrivateShare(e Encryptor, p Participant, serializedShare []byte) (*pb.PrivateShare, error)
func LoadX509Certificate ¶
func LoadX509Certificate(certFile string) (*x509.Certificate, error)
func SplitAndEncrypt ¶
Types ¶
type EncryptionResult ¶
type EncryptionResult struct { CipherText *pb.CipherText }
type EncryptionScheme ¶
type EncryptionScheme struct {
// contains filtered or unexported fields
}
func NewEncryptionScheme ¶
func NewEncryptionScheme(encryptor Encryptor, participants []Participant, numPublicShares, threshold int) (*EncryptionScheme, error)
func (EncryptionScheme) Encrypt ¶
func (e EncryptionScheme) Encrypt(msg []byte) (*EncryptionResult, error)
type KeyStore ¶
type KeyStore interface { Participant(identifier string) (Participant, error) Encryptor() Encryptor }
func NewMemoryKeyStore ¶
func NewMemoryKeyStore(store map[string]Participant, encryptor Encryptor) KeyStore
type MemoryKeyStore ¶
type MemoryKeyStore struct {
// contains filtered or unexported fields
}
func (*MemoryKeyStore) Encryptor ¶
func (s *MemoryKeyStore) Encryptor() Encryptor
func (*MemoryKeyStore) Participant ¶
func (s *MemoryKeyStore) Participant(identifier string) (Participant, error)
type Participant ¶
type Share ¶
type Share struct {}
func DecryptAndVerifyShare ¶
func DecryptAndVerifyShare(keyStore KeyStore, s *pb.PrivateShare) (*Share, error)
func VerifyPublicShare ¶
func VerifyPublicShare(keyStore KeyStore, s *pb.PublicShare) (*Share, error)
type TLSEncryptor ¶
type TLSEncryptor struct { TlsCert tls.Certificate // contains filtered or unexported fields }
func LoadTLSEncryptor ¶
func LoadTLSEncryptor(certFile, keyFile string) (*TLSEncryptor, error)
func NewTLSEncryptor ¶
func NewTLSEncryptor(tlsCert tls.Certificate, x509Cert *x509.Certificate) *TLSEncryptor
func (*TLSEncryptor) Identifier ¶
func (e *TLSEncryptor) Identifier() string
func (*TLSEncryptor) Public ¶
func (e *TLSEncryptor) Public() crypto.PublicKey
func (*TLSEncryptor) Sign ¶
func (e *TLSEncryptor) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)
type X509Participant ¶
type X509Participant struct {
// contains filtered or unexported fields
}
func LoadX509Participant ¶
func LoadX509Participant(certFile string) (*X509Participant, error)
func NewX509Participant ¶
func NewX509Participant(cert *x509.Certificate) *X509Participant
func (*X509Participant) Identifier ¶
func (p *X509Participant) Identifier() string
func (*X509Participant) Verify ¶
func (p *X509Participant) Verify(signature, hash []byte) error
Click to show internal directories.
Click to hide internal directories.