@@ -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