mirror of https://github.com/docker/docs.git
Merge pull request #30 from endophage/rufus_update
populate key and signature type from rufus's Algorithm field
This commit is contained in:
commit
ce0ed53fa2
|
@ -53,7 +53,7 @@ func (trust *RufusSigner) Sign(keyIDs []string, toSign []byte) ([]data.Signature
|
||||||
}
|
}
|
||||||
signatures = append(signatures, data.Signature{
|
signatures = append(signatures, data.Signature{
|
||||||
KeyID: sig.KeyID.ID,
|
KeyID: sig.KeyID.ID,
|
||||||
Method: "TODOALGORITHM",
|
Method: sig.Algorithm,
|
||||||
Signature: sig.Content,
|
Signature: sig.Content,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ func (trust *RufusSigner) Create(role string) (*data.PublicKey, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
//TODO(mccauley): Update API to return algorithm and/or take it as a param
|
//TODO(mccauley): Update API to return algorithm and/or take it as a param
|
||||||
public := data.NewPublicKey("TODOALGORITHM", publicKey.PublicKey)
|
public := data.NewPublicKey(publicKey.Algorithm, publicKey.PublicKey)
|
||||||
return public, nil
|
return public, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,12 +76,12 @@ func (trust *RufusSigner) PublicKeys(keyIDs ...string) (map[string]*data.PublicK
|
||||||
publicKeys := make(map[string]*data.PublicKey)
|
publicKeys := make(map[string]*data.PublicKey)
|
||||||
for _, ID := range keyIDs {
|
for _, ID := range keyIDs {
|
||||||
keyID := pb.KeyID{ID: ID}
|
keyID := pb.KeyID{ID: ID}
|
||||||
sig, err := trust.kmClient.GetKeyInfo(context.Background(), &keyID)
|
public, err := trust.kmClient.GetKeyInfo(context.Background(), &keyID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
publicKeys[sig.KeyID.ID] =
|
publicKeys[public.KeyID.ID] =
|
||||||
data.NewPublicKey("TODOALGORITHM", sig.PublicKey)
|
data.NewPublicKey(public.Algorithm, public.PublicKey)
|
||||||
}
|
}
|
||||||
return publicKeys, nil
|
return publicKeys, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue