From 8902c8c0e99125ea08a10befbc5cf3ac2c0f4ab5 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Fri, 30 Oct 2015 21:23:55 -0700 Subject: [PATCH] fix go lint Signed-off-by: Jessica Frazelle Signed-off-by: David Lawrence Signed-off-by: Jessica Frazelle (github: endophage) --- keystoremanager/keystoremanager.go | 3 ++- tuf/data/keys.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 "" }