Documentation ¶
Overview ¶
Package signingtest implements signing.Signer interface using small random keys.
Useful in unit tests.
Index ¶
- type Signer
- func (s *Signer) Certificates(ctx context.Context) (*signing.PublicCertificates, error)
- func (s *Signer) KeyForTest() *rsa.PrivateKey
- func (s *Signer) KeyNameForTest() string
- func (s *Signer) ServiceInfo(ctx context.Context) (*signing.ServiceInfo, error)
- func (s *Signer) SignBytes(ctx context.Context, blob []byte) (keyName string, signature []byte, err error)
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(serviceInfo *signing.ServiceInfo) *Signer
NewSigner returns Signer instance that use small random key.
Panics on errors.
func (*Signer) Certificates ¶
Certificates returns a bundle with public certificates for all active keys.
func (*Signer) KeyForTest ¶
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 ¶
KeyNameForTest returns an ID of the signing key.
func (*Signer) ServiceInfo ¶
ServiceInfo returns information about the current service.
It includes app ID and the service account name (that ultimately owns the signing private key).