Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d77e5d7

Browse files
committed
Made to more static helper methods publicly accessible.
1 parent 77945d4 commit d77e5d7

File tree

1 file changed

+14
-2
lines changed
  • src/main/java/de/christofreichardt/json/websignature

1 file changed

+14
-2
lines changed

‎src/main/java/de/christofreichardt/json/websignature/JWSBase.java‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,23 @@ abstract public class JWSBase {
4141
"HS256", HmacSHA256.class, "RS256", SHA256withRSA.class, "ES256", SHA256withECDSA.class, "ES512", SHA512WithECDSA.class
4242
);
4343

44-
static String encode(String input) {
44+
/**
45+
* Encodes the given {@code input} by first taking its UTF-8 encoded bytes and next using the base64-url-encoding scheme.
46+
*
47+
* @param input the to be encoded {@code String}
48+
* @return the resulting base64-url-encoded {@code String}
49+
*/
50+
public static String encode(String input) {
4551
return BASE64_URL_ENCODER.encodeToString(input.getBytes(StandardCharsets.UTF_8));
4652
}
4753

48-
static String encode(byte[] input) {
54+
/**
55+
* Encodes the given {@code input} using the base64-url-encoding scheme.
56+
*
57+
* @param input the to be encoded bytes
58+
* @return the resulting base64-url-encoded {@code String}
59+
*/
60+
public static String encode(byte[] input) {
4961
return BASE64_URL_ENCODER.encodeToString(input);
5062
}
5163

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /