From 8469f35bf788c97b1df2d089b1838b6e7367b9ed Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 28 Feb 2019 00:54:01 +0000 Subject: [PATCH] fix bad JWK string --- keypairs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keypairs.go b/keypairs.go index 1f7adc6..942969a 100644 --- a/keypairs.go +++ b/keypairs.go @@ -160,7 +160,7 @@ func MarshalECPublicKey(k *ecdsa.PublicKey, exp ...time.Time) []byte { if 0 != len(exp) { expstr = fmt.Sprintf(`"exp":%d,`, exp[0].Unix()) } - return []byte(fmt.Sprintf(`{"kid":%q,"use":"sig",%s"crv":%q,"kty":"EC","x":%q,"y":%q}`, expstr, thumb, crv, x, y)) + return []byte(fmt.Sprintf(`{"kid":%q,"use":"sig",%s"crv":%q,"kty":"EC","x":%q,"y":%q}`, thumb, expstr, crv, x, y)) } func MarshalECPublicKeyWithoutKeyID(k *ecdsa.PublicKey) []byte { @@ -184,7 +184,7 @@ func MarshalRSAPublicKey(p *rsa.PublicKey, exp ...time.Time) []byte { if 0 != len(exp) { expstr = fmt.Sprintf(`"exp":%d,`, exp[0].Unix()) } - return []byte(fmt.Sprintf(`{"kid":%q,"use":"sig",%s"e":%q,"kty":"RSA","n":%q}`, expstr, thumb, e, n)) + return []byte(fmt.Sprintf(`{"kid":%q,"use":"sig",%s"e":%q,"kty":"RSA","n":%q}`, thumb, expstr, e, n)) } func MarshalRSAPublicKeyWithoutKeyID(p *rsa.PublicKey) []byte {