Skip to content

Commit 13c5862

Browse files
committed
fix: Change curve name from P-256 to secp256k1.
Signed-off-by: Markus Sabadello <[email protected]>
1 parent 3dbc34c commit 13c5862

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
import info.weboftrust.ldsignatures.crypto.adapter.JWSVerifierAdapter;
2121
import info.weboftrust.ldsignatures.crypto.impl.Ed25519_EdDSA_PrivateKeySigner;
2222
import info.weboftrust.ldsignatures.crypto.impl.Ed25519_EdDSA_PublicKeyVerifier;
23-
import info.weboftrust.ldsignatures.crypto.impl.P256K_ES256K_PrivateKeySigner;
24-
import info.weboftrust.ldsignatures.crypto.impl.P256K_ES256K_PublicKeyVerifier;
2523
import info.weboftrust.ldsignatures.crypto.impl.RSA_RS256_PrivateKeySigner;
2624
import info.weboftrust.ldsignatures.crypto.impl.RSA_RS256_PublicKeyVerifier;
25+
import info.weboftrust.ldsignatures.crypto.impl.secp256k1_ES256K_PrivateKeySigner;
26+
import info.weboftrust.ldsignatures.crypto.impl.secp256k1_ES256K_PublicKeyVerifier;
2727

2828
abstract class JwtObject <T> {
2929

@@ -98,7 +98,7 @@ public String sign_P256K_ES256K(ByteSigner signer) throws JOSEException {
9898

9999
public String sign_P256K_ES256K(ECKey privateKey) throws JOSEException {
100100

101-
return this.sign_P256K_ES256K(new P256K_ES256K_PrivateKeySigner(privateKey));
101+
return this.sign_P256K_ES256K(new secp256k1_ES256K_PrivateKeySigner(privateKey));
102102
}
103103

104104
public String sign_P256K_ES256K(com.nimbusds.jose.jwk.ECKey privateKey) throws JOSEException {
@@ -152,7 +152,7 @@ public boolean verify_P256K_ES256K(ByteVerifier verifier) throws JOSEException {
152152

153153
public boolean verify_P256K_ES256K(ECKey publicKey) throws JOSEException {
154154

155-
return this.verify_P256K_ES256K(new P256K_ES256K_PublicKeyVerifier(publicKey));
155+
return this.verify_P256K_ES256K(new secp256k1_ES256K_PublicKeyVerifier(publicKey));
156156
}
157157

158158
public boolean verify_P256K_ES256K(com.nimbusds.jose.jwk.ECKey publicKey) throws JOSEException {
@@ -163,15 +163,15 @@ public boolean verify_P256K_ES256K(com.nimbusds.jose.jwk.ECKey publicKey) throws
163163
/*
164164
* Helper class
165165
*/
166-
166+
167167
private static class EscapedSlashWorkaroundJWSObject extends JWSObject {
168168

169169
public EscapedSlashWorkaroundJWSObject(final JWSHeader header, final JWTClaimsSet claimsSet) {
170170

171171
super(header, new Payload(claimsSet.toJSONObject().toJSONString().replace("\\/", "/")));
172172
}
173173
}
174-
174+
175175
/*
176176
* Getters
177177
*/

0 commit comments

Comments
 (0)