crypto

package
v0.0.0-...-f1c747c Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package crypto provides signing functionality for Trillian.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashLogRoot

func HashLogRoot(root trillian.SignedLogRoot) []byte

HashLogRoot hashes SignedLogRoot objects using ObjectHash with "RootHash", "TimestampNanos", and "TreeSize", used as keys in a map.

func Verify

func Verify(pub crypto.PublicKey, data []byte, sig *sigpb.DigitallySigned) error

Verify cryptographically verifies the output of Signer.

func VerifyObject

func VerifyObject(pub crypto.PublicKey, obj interface{}, sig *sigpb.DigitallySigned) error

VerifyObject verifies the output of Signer.SignObject.

Types

type Signer

type Signer struct {
	Hash   crypto.Hash
	Signer crypto.Signer
}

Signer is responsible for signing log-related data and producing the appropriate application specific signature objects.

func NewSHA256Signer

func NewSHA256Signer(signer crypto.Signer) *Signer

NewSHA256Signer creates a new SHA256 based Signer.

func (*Signer) Public

func (s *Signer) Public() crypto.PublicKey

Public returns the public key that can verify signatures produced by s.

func (*Signer) Sign

func (s *Signer) Sign(data []byte) (*sigpb.DigitallySigned, error)

Sign obtains a signature after first hashing the input data.

func (*Signer) SignObject

func (s *Signer) SignObject(obj interface{}) (*sigpb.DigitallySigned, error)

SignObject signs the requested object using ObjectHash.

Directories

Path Synopsis
Package keys provides access to public and private keys for signing and verification of signatures.
Package keys provides access to public and private keys for signing and verification of signatures.
Package keyspb is a generated protocol buffer package.
Package keyspb is a generated protocol buffer package.
Package sigpb is a generated protocol buffer package.
Package sigpb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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