From 295a7342f2f6afb42c8264a0c5f49c63bc224296 Mon Sep 17 00:00:00 2001 From: Dave Grijalva Date: Tue, 26 Feb 2013 21:29:51 -0800 Subject: [PATCH] gofmt --- rs256.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rs256.go b/rs256.go index 9cadf6d..2a29aa2 100644 --- a/rs256.go +++ b/rs256.go @@ -30,17 +30,17 @@ func (m *SigningMethodRS256) Verify(signingString, signature string, key []byte) if block, _ = pem.Decode(key); block != nil { var parsedKey interface{} if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil { - parsedKey, err = x509.ParseCertificate(block.Bytes) - } - if err == nil { + parsedKey, err = x509.ParseCertificate(block.Bytes) + } + if err == nil { if rsaKey, ok := parsedKey.(*rsa.PublicKey); ok { hasher := sha256.New() hasher.Write([]byte(signingString)) err = rsa.VerifyPKCS1v15(rsaKey, crypto.SHA256, hasher.Sum(nil), sig) } else if cert, ok := parsedKey.(*x509.Certificate); ok { - err = cert.CheckSignature(x509.SHA256WithRSA, []byte(signingString), sig) - } else { + err = cert.CheckSignature(x509.SHA256WithRSA, []byte(signingString), sig) + } else { err = errors.New("Key is not a valid RSA public key") } }