api

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2016 License: Apache-2.0 Imports: 14 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKey

func CreateKey(cryptoServices signer.CryptoServiceIndex) http.Handler

CreateKey returns a handler that generates a new key using the provided algorithm. Only the public component of the key is returned.

func DeleteKey

func DeleteKey(cryptoServices signer.CryptoServiceIndex) http.Handler

DeleteKey returns a handler that delete a specific KeyID

func FindKeyByID

func FindKeyByID(cryptoServices signer.CryptoServiceIndex, keyID *pb.KeyID) (data.PublicKey, signed.CryptoService, error)

FindKeyByID looks for the key with the given ID in each of the signing services in sigServices. It returns the first matching key it finds, or ErrInvalidKeyID if the key is not found in any of the signing services. It also returns the CryptoService associated with the key, so the caller can perform operations with the key (such as signing).

func Handlers

func Handlers(cryptoServices signer.CryptoServiceIndex) *mux.Router

Handlers sets up all the handers for the routes, injecting a specific CryptoService object for them to use

func KeyInfo

func KeyInfo(cryptoServices signer.CryptoServiceIndex) http.Handler

KeyInfo returns a Handler that given a specific Key ID param, returns the public key bits of that key

func Sign

func Sign(cryptoServices signer.CryptoServiceIndex) http.Handler

Sign returns a handler that is able to perform signatures on a given blob

Types

type KeyManagementServer

type KeyManagementServer struct {
	CryptoServices signer.CryptoServiceIndex
	HealthChecker  func() map[string]string
}

KeyManagementServer implements the KeyManagementServer grpc interface

func (*KeyManagementServer) CheckHealth

func (s *KeyManagementServer) CheckHealth(ctx context.Context, v *pb.Void) (*pb.HealthStatus, error)

CheckHealth returns the HealthStatus with the service

func (*KeyManagementServer) CreateKey

func (s *KeyManagementServer) CreateKey(ctx context.Context, algorithm *pb.Algorithm) (*pb.PublicKey, error)

CreateKey returns a PublicKey created using KeyManagementServer's SigningService

func (*KeyManagementServer) DeleteKey

func (s *KeyManagementServer) DeleteKey(ctx context.Context, keyID *pb.KeyID) (*pb.Void, error)

DeleteKey deletes they key associated with a KeyID

func (*KeyManagementServer) GetKeyInfo

func (s *KeyManagementServer) GetKeyInfo(ctx context.Context, keyID *pb.KeyID) (*pb.PublicKey, error)

GetKeyInfo returns they PublicKey associated with a KeyID

type SignerServer

type SignerServer struct {
	CryptoServices signer.CryptoServiceIndex
	HealthChecker  func() map[string]string
}

SignerServer implements the SignerServer grpc interface

func (*SignerServer) CheckHealth

func (s *SignerServer) CheckHealth(ctx context.Context, v *pb.Void) (*pb.HealthStatus, error)

CheckHealth returns the HealthStatus with the service

func (*SignerServer) Sign

Sign signs a message and returns the signature using a private key associate with the KeyID from the SignatureRequest

Jump to

Keyboard shortcuts

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