Skip to content

Commit 0c25b8c

Browse files
committed
Introduce JwaAlgorithm
Closes gh-9182
1 parent c069692 commit 0c25b8c

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2002-2020 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.security.oauth2.jose;
18+
19+
/**
20+
* Super interface for cryptographic algorithms defined by the JSON Web Algorithms (JWA)
21+
* specification and used by JSON Web Signature (JWS) to digitally sign or create a MAC of
22+
* the contents and JSON Web Encryption (JWE) to encrypt the contents.
23+
*
24+
* @author Joe Grandja
25+
* @since 5.5
26+
* @see <a target="_blank" href="https://tools.ietf.org/html/rfc7518">JSON Web Algorithms
27+
* (JWA)</a>
28+
* @see <a target="_blank" href="https://tools.ietf.org/html/rfc7515">JSON Web Signature
29+
* (JWS)</a>
30+
* @see <a target="_blank" href="https://tools.ietf.org/html/rfc7516">JSON Web Encryption
31+
* (JWE)</a>
32+
*/
33+
public interface JwaAlgorithm {
34+
35+
/**
36+
* Returns the algorithm name.
37+
* @return the algorithm name
38+
*/
39+
String getName();
40+
41+
}

oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jose/jws/JwsAlgorithm.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,13 +16,16 @@
1616

1717
package org.springframework.security.oauth2.jose.jws;
1818

19+
import org.springframework.security.oauth2.jose.JwaAlgorithm;
20+
1921
/**
2022
* Super interface for cryptographic algorithms defined by the JSON Web Algorithms (JWA)
2123
* specification and used by JSON Web Signature (JWS) to digitally sign or create a MAC of
2224
* the contents of the JWS Protected Header and JWS Payload.
2325
*
2426
* @author Joe Grandja
2527
* @since 5.2
28+
* @see JwaAlgorithm
2629
* @see <a target="_blank" href="https://tools.ietf.org/html/rfc7518">JSON Web Algorithms
2730
* (JWA)</a>
2831
* @see <a target="_blank" href="https://tools.ietf.org/html/rfc7515">JSON Web Signature
@@ -31,8 +34,6 @@
3134
* "https://tools.ietf.org/html/rfc7518#section-3">Cryptographic Algorithms for Digital
3235
* Signatures and MACs</a>
3336
*/
34-
public interface JwsAlgorithm {
35-
36-
String getName();
37+
public interface JwsAlgorithm extends JwaAlgorithm {
3738

3839
}

0 commit comments

Comments
 (0)