Added possibility to create JWS object with specific algo hs256 or none easily.

This commit is contained in:
Jocelyn Fiat
2017-06-14 16:26:31 +02:00
parent 1ec3b8e7a4
commit 10a83c6ad8

View File

@@ -1,6 +1,5 @@
note
description: "Summary description for {JWS}."
author: ""
date: "$Date$"
revision: "$Revision$"
@@ -9,19 +8,35 @@ class
inherit
JWT
redefine
default_create
end
JWT_UTILITIES
undefine
redefine
default_create
end
create
default_create,
make_with_algorithm,
make_with_claims,
make_with_json_payload
feature {NONE} -- Initialization
default_create
do
Precursor {JWT}
set_algorithm_to_hs256
end
make_with_algorithm (alg: like algorithm)
do
default_create
set_algorithm (alg)
end
make_with_claims (tb: STRING_TABLE [READABLE_STRING_GENERAL])
do
default_create
@@ -77,4 +92,14 @@ feature -- Element change
header.set_algorithm (alg)
end
set_algorithm_to_hs256
do
set_algorithm (alg_hs256)
end
set_algorithm_to_none
do
set_algorithm (alg_none)
end
end