mirror of
https://github.com/docker/docs.git
synced 2026-10-31 10:34:26 +03:00
Comment: improve some comment
To keep consistent with the comment about the interface. Signed-off-by: Hu Keping <hukeping@huawei.com>
This commit is contained in:
@@ -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)}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user