mirror of https://github.com/docker/docs.git
Merge pull request #93 from docker/complete-notary-signer
Implement missing functions in NotarySigner to fully satisfy CryptoService interface
This commit is contained in:
commit
eb8370f517
|
@ -1,7 +1,6 @@
|
||||||
package signer
|
package signer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/Sirupsen/logrus"
|
"github.com/Sirupsen/logrus"
|
||||||
|
@ -75,12 +74,15 @@ func (trust *NotarySigner) Create(role string, algorithm data.KeyAlgorithm) (dat
|
||||||
|
|
||||||
// RemoveKey deletes a key
|
// RemoveKey deletes a key
|
||||||
func (trust *NotarySigner) RemoveKey(keyid string) error {
|
func (trust *NotarySigner) RemoveKey(keyid string) error {
|
||||||
//TODO(aaronl): Not implemented yet
|
_, err := trust.kmClient.DeleteKey(context.Background(), &pb.KeyID{ID: keyid})
|
||||||
return errors.New("DeleteKey not implemented in NotarySigner")
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetKey retrieves a key
|
// GetKey retrieves a key
|
||||||
func (trust *NotarySigner) GetKey(keyid string) data.PublicKey {
|
func (trust *NotarySigner) GetKey(keyid string) data.PublicKey {
|
||||||
//TODO(aaronl): Not implemented yet
|
publicKey, err := trust.kmClient.GetKeyInfo(context.Background(), &pb.KeyID{ID: keyid})
|
||||||
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
return data.NewPublicKey(data.KeyAlgorithm(publicKey.KeyInfo.Algorithm.Algorithm), publicKey.PublicKey)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue