luci: go.chromium.org/luci/server/auth/signing/signingtest Index | Files

package signingtest

import "go.chromium.org/luci/server/auth/signing/signingtest"

Package signingtest implements signing.Signer interface using small random keys.

Useful in unit tests.

Index

Package Files

doc.go signer.go

type Signer Uses

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

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

func NewSigner Uses

func NewSigner(serviceInfo *signing.ServiceInfo) *Signer

NewSigner returns Signer instance that use small random key.

Panics on errors.

func (*Signer) Certificates Uses

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

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

func (*Signer) KeyForTest Uses

func (s *Signer) KeyForTest() *rsa.PrivateKey

KeyForTest returns the RSA key used internally by the test signer.

It is not part of the signing.Signer interface. It should be used only from tests.

func (*Signer) KeyNameForTest Uses

func (s *Signer) KeyNameForTest() string

KeyNameForTest returns an ID of the signing key.

func (*Signer) ServiceInfo Uses

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 Uses

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.

Package signingtest imports 11 packages (graph). Updated 2018-12-19. Refresh now. Tools for package owners.