Documentation ¶
Index ¶
- func CreateKey(cryptoServices signer.CryptoServiceIndex) http.Handler
- func DeleteKey(cryptoServices signer.CryptoServiceIndex) http.Handler
- func FindKeyByID(cryptoServices signer.CryptoServiceIndex, keyID *pb.KeyID) (data.Key, signed.CryptoService, error)
- func Handlers(cryptoServices signer.CryptoServiceIndex) *mux.Router
- func KeyInfo(cryptoServices signer.CryptoServiceIndex) http.Handler
- func Sign(cryptoServices signer.CryptoServiceIndex) http.Handler
- type KeyManagementServer
- func (s *KeyManagementServer) CreateKey(ctx context.Context, algorithm *pb.Algorithm) (*pb.PublicKey, error)
- func (s *KeyManagementServer) DeleteKey(ctx context.Context, keyID *pb.KeyID) (*pb.Void, error)
- func (s *KeyManagementServer) GetKeyInfo(ctx context.Context, keyID *pb.KeyID) (*pb.PublicKey, error)
- type RSAHardwareCryptoService
- func (s *RSAHardwareCryptoService) Create(role string, algo data.KeyAlgorithm) (data.PublicKey, error)
- func (s *RSAHardwareCryptoService) GetKey(keyID string) data.PublicKey
- func (s *RSAHardwareCryptoService) RemoveKey(keyID string) error
- func (s *RSAHardwareCryptoService) Sign(keyIDs []string, payload []byte) ([]data.Signature, error)
- type SignerServer
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
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.Key, 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
Types ¶
type KeyManagementServer ¶
type KeyManagementServer struct {
CryptoServices signer.CryptoServiceIndex
}
KeyManagementServer implements the KeyManagementServer grpc interface
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) GetKeyInfo ¶
func (s *KeyManagementServer) GetKeyInfo(ctx context.Context, keyID *pb.KeyID) (*pb.PublicKey, error)
GetKeyInfo returns they PublicKey associated with a KeyID
type RSAHardwareCryptoService ¶
type RSAHardwareCryptoService struct {
// contains filtered or unexported fields
}
RSAHardwareCryptoService is an implementation of SigningService
func NewRSAHardwareCryptoService ¶
func NewRSAHardwareCryptoService(ctx *pkcs11.Ctx, session pkcs11.SessionHandle) *RSAHardwareCryptoService
NewRSAHardwareCryptoService returns an instance of RSAHardwareCryptoService
func (*RSAHardwareCryptoService) Create ¶
func (s *RSAHardwareCryptoService) Create(role string, algo data.KeyAlgorithm) (data.PublicKey, error)
Create creates a key and returns its public components
func (*RSAHardwareCryptoService) GetKey ¶
func (s *RSAHardwareCryptoService) GetKey(keyID string) data.PublicKey
GetKey returns the public components of a particular key
func (*RSAHardwareCryptoService) RemoveKey ¶
func (s *RSAHardwareCryptoService) RemoveKey(keyID string) error
RemoveKey removes a key from the key database
type SignerServer ¶
type SignerServer struct {
CryptoServices signer.CryptoServiceIndex
}
SignerServer implements the SignerServer grpc interface
func (*SignerServer) Sign ¶
func (s *SignerServer) Sign(ctx context.Context, sr *pb.SignatureRequest) (*pb.Signature, error)
Sign signs a message and returns the signature using a private key associate with the KeyID from the SignatureRequest