diff --git a/cryptoservice/crypto_service.go b/cryptoservice/crypto_service.go index d473564da4..f5bfa073b0 100644 --- a/cryptoservice/crypto_service.go +++ b/cryptoservice/crypto_service.go @@ -73,9 +73,9 @@ func (cs *CryptoService) Create(role, algorithm string) (data.PublicKey, error) } -// GetPrivateKey returns a private key by ID. It tries to get the key first -// without a GUN (in which case it's a root key). If that fails, try to get -// the key with the GUN (non-root key). +// GetPrivateKey returns a private key and role if present by ID. +// It tries to get the key first without a GUN (in which case it's a root key). +// If that fails, try to get the key with the GUN (non-root key). // If that fails, then we don't have the key. func (cs *CryptoService) GetPrivateKey(keyID string) (k data.PrivateKey, role string, err error) { keyPaths := []string{keyID, filepath.Join(cs.gun, keyID)} diff --git a/tuf/signed/ed25519.go b/tuf/signed/ed25519.go index 3f7ad1ed28..e09b550501 100644 --- a/tuf/signed/ed25519.go +++ b/tuf/signed/ed25519.go @@ -95,7 +95,7 @@ func (e *Ed25519) GetKey(keyID string) data.PublicKey { return data.PublicKeyFromPrivate(e.keys[keyID].privKey) } -// GetPrivateKey returns a single private key based on the ID +// GetPrivateKey returns a single private key and role if present, based on the ID func (e *Ed25519) GetPrivateKey(keyID string) (data.PrivateKey, string, error) { if k, ok := e.keys[keyID]; ok { return k.privKey, k.role, nil