Skip to content

Commit acee016

Browse files
committed
fix: Added more validation
1 parent a52c365 commit acee016

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/danubetech/verifiablecredentials/jwt/JwtObject.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public JwtObject(JWTClaimsSet payload, JWSObject jwsObject, String compactSerial
4949
*/
5050

5151
private String sign(JWSSigner jwsSigner, JWSAlgorithm alg, String kid, boolean canonicalize) throws JOSEException {
52-
53-
if(this.header == null || this.header.getKeyID() == null){
52+
53+
if(this.header == null || this.header.getKeyID() == null || this.header.getAlgorithm() == null){
5454
JWSHeader.Builder jwsHeaderBuilder = new JWSHeader.Builder(alg);
5555
jwsHeaderBuilder.type(JOSEObjectType.JWT);
5656
if (kid != null) jwsHeaderBuilder.keyID(kid);

0 commit comments

Comments
 (0)