CovenantSQL: github.com/CovenantSQL/CovenantSQL/crypto/verifier Index | Files

package verifier

import "github.com/CovenantSQL/CovenantSQL/crypto/verifier"

Index

Package Files

common.go common_gen.go errors.go

Variables

var (
    // ErrHashValueNotMatch indicates the hash value not match error from verifier.
    ErrHashValueNotMatch = errors.New("hash value not match")
    // ErrSignatureNotMatch indicates the signature not match error from verifier.
    ErrSignatureNotMatch = errors.New("signature not match")
)

type DefaultHashSignVerifierImpl Uses

type DefaultHashSignVerifierImpl struct {
    DataHash  hash.Hash
    Signee    *ca.PublicKey
    Signature *ca.Signature
}

DefaultHashSignVerifierImpl defines a default implementation of HashSignVerifier.

func (*DefaultHashSignVerifierImpl) Hash Uses

func (i *DefaultHashSignVerifierImpl) Hash() hash.Hash

Hash implements HashSignVerifier.Hash.

func (*DefaultHashSignVerifierImpl) MarshalHash Uses

func (z *DefaultHashSignVerifierImpl) MarshalHash() (o []byte, err error)

MarshalHash marshals for hash

func (*DefaultHashSignVerifierImpl) Msgsize Uses

func (z *DefaultHashSignVerifierImpl) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*DefaultHashSignVerifierImpl) SetHash Uses

func (i *DefaultHashSignVerifierImpl) SetHash(mh MarshalHasher) (err error)

SetHash implements HashSignVerifier.SetHash.

func (*DefaultHashSignVerifierImpl) Sign Uses

func (i *DefaultHashSignVerifierImpl) Sign(mh MarshalHasher, signer *ca.PrivateKey) (err error)

Sign implements HashSignVerifier.Sign.

func (*DefaultHashSignVerifierImpl) SignHash Uses

func (i *DefaultHashSignVerifierImpl) SignHash(signer *ca.PrivateKey) (err error)

SignHash implements HashSignVerifier.SignHash.

func (*DefaultHashSignVerifierImpl) Verify Uses

func (i *DefaultHashSignVerifierImpl) Verify(mh MarshalHasher) (err error)

Verify implements HashSignVerifier.Verify.

func (*DefaultHashSignVerifierImpl) VerifyHash Uses

func (i *DefaultHashSignVerifierImpl) VerifyHash(mh MarshalHasher) (err error)

VerifyHash implements HashSignVerifier.VerifyHash.

func (*DefaultHashSignVerifierImpl) VerifySignature Uses

func (i *DefaultHashSignVerifierImpl) VerifySignature() (err error)

VerifySignature implements HashSignVerifier.VerifySignature.

type HashSignVerifier Uses

type HashSignVerifier interface {
    Hash() hash.Hash
    SetHash(MarshalHasher) error
    SignHash(*ca.PrivateKey) error
    Sign(MarshalHasher, *ca.PrivateKey) error
    VerifyHash(MarshalHasher) error
    VerifySignature() error
    Verify(MarshalHasher) error
}

HashSignVerifier is the interface implemented by an object that contains a hash value of an MarshalHasher, can be signed by a private key and verified later.

type MarshalHasher Uses

type MarshalHasher interface {
    MarshalHash() ([]byte, error)
}

MarshalHasher is the interface implemented by an object that can be stably marshalling hashed.

Package verifier imports 5 packages (graph) and is imported by 4 packages. Updated 2019-03-11. Refresh now. Tools for package owners.