summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2017-05-10 19:51:17 +0100
committerRobert Newson <rnewson@apache.org>2017-05-10 19:51:17 +0100
commitae0e0f495db22069e6c811462cd974fea7ae7ad8 (patch)
tree2bde156238e7fdc0df5391f126fe2a5d7cce7450
parent373a3671fa576d762e4dab89a655b9536885a15f (diff)
downloadcouchdb-ae0e0f495db22069e6c811462cd974fea7ae7ad8.tar.gz
return a public key tuple
-rw-r--r--src/jwks.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/jwks.erl b/src/jwks.erl
index d1863303c..a2231b2f4 100644
--- a/src/jwks.erl
+++ b/src/jwks.erl
@@ -55,8 +55,10 @@ parse_key({Props}) ->
X = proplists:get_value(<<"x">>, Props),
Y = proplists:get_value(<<"y">>, Props),
Point = <<4:8, X/binary, Y/binary>>,
- [{{Kty, Kid}, #'ECPoint'{
- point = Point}}];
+ [{{Kty, Kid}, {
+ #'ECPoint'{point = Point},
+ {namedCurve, secp256r1}
+ }}];
_ ->
[]
end;
@@ -103,6 +105,7 @@ ec_test() ->
{<<"kid">>, <<"1">>}
]},
%% TODO figure out how to convert x,y to an ECPoint.
- ?assertMatch([{{<<"EC">>, <<"1">>}, {'ECPoint', _}}], parse_key(Ejson)).
+ ?assertMatch([{{<<"EC">>, <<"1">>}, {{'ECPoint', _},
+ {namedCurve, secp256r1}}}], parse_key(Ejson)).
-endif.