signingtest

package
v0.0.0-...-678bb0e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package signingtest implements signing.Signer interface using fake keys. Useful in unit tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Signer

type Signer struct {
	// contains filtered or unexported fields
}

Signer holds private key and corresponding cert and can sign blobs with PKCS1v15.

func NewSigner

func NewSigner(seed int64, serviceInfo *signing.ServiceInfo) *Signer

NewSigner returns Signer instance deterministically deriving the key from the given seed. Panics on errors.

func (*Signer) Certificates

func (s *Signer) Certificates(c context.Context) (*signing.PublicCertificates, error)

Certificates returns a bundle with public certificates for all active keys.

func (*Signer) ServiceInfo

func (s *Signer) ServiceInfo(c context.Context) (*signing.ServiceInfo, error)

ServiceInfo returns information about the current service.

It includes app ID and the service account name (that ultimately owns the signing private key).

func (*Signer) SignBytes

func (s *Signer) SignBytes(c context.Context, blob []byte) (keyName string, signature []byte, err error)

SignBytes signs the blob with some active private key. Returns the signature and name of the key used.

Jump to

Keyboard shortcuts

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