diff --git a/keystoremanager/keystoremanager.go b/keystoremanager/keystoremanager.go index 09f336de0b..6b61f1c009 100644 --- a/keystoremanager/keystoremanager.go +++ b/keystoremanager/keystoremanager.go @@ -24,7 +24,8 @@ type KeyStoreManager struct { } const ( - trustDir = "trusted_certificates" + trustDir = "trusted_certificates" + // PrivDir is the name of the private directory PrivDir = "private" rsaRootKeySize = 4096 // Used for new root keys ) diff --git a/tuf/data/keys.go b/tuf/data/keys.go index 22a1fb786c..63582db054 100644 --- a/tuf/data/keys.go +++ b/tuf/data/keys.go @@ -486,18 +486,22 @@ func (k UnknownPrivateKey) Sign(rand io.Reader, msg []byte, opts crypto.SignerOp return nil, errors.New("Unknown key type, cannot sign.") } +// SignatureAlgorithm returns the SigAlgorithm for a ECDSAPrivateKey func (k ECDSAPrivateKey) SignatureAlgorithm() SigAlgorithm { return ECDSASignature } +// SignatureAlgorithm returns the SigAlgorithm for a RSAPrivateKey func (k RSAPrivateKey) SignatureAlgorithm() SigAlgorithm { return RSAPSSSignature } +// SignatureAlgorithm returns the SigAlgorithm for a ED25519PrivateKey func (k ED25519PrivateKey) SignatureAlgorithm() SigAlgorithm { return EDDSASignature } +// SignatureAlgorithm returns the SigAlgorithm for an UnknownPrivateKey func (k UnknownPrivateKey) SignatureAlgorithm() SigAlgorithm { return "" }