-
Notifications
You must be signed in to change notification settings - Fork 23
Feature/support es256 k #274
Feature/support es256 k #274
Conversation
207f4fc
to
9f50bc2
Compare
} else { | ||
JWSAlgorithm algorithm = JWSAlgorithm.ES256K; | ||
JOSEObjectType type = JOSEObjectType.JWT; | ||
JWSHeader header = new JWSHeader(algorithm, type, null, null, null, null, null, null, null, null, issuer, true, null, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the JWSHeader.Builder
as it is more expressive than the constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the builder it looks much better, fixed 541a524
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, will merge after manual tests pass.
@aleksandra-bel @andreibogus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update DID document, adding the newly issued key to the list of verificationMethod.
added WalletKey for ES256K algorithm to DidDocument |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok this time I think we're done 😆
Doing manual sweep and I'll merge when I'm done with that.
private JWKVerificationMethod getJwkVerificationMethod(ECKey ecKey, Did did) { | ||
Map<String, Object> verificationMethodJson = new HashMap<>(); | ||
Map<String, String> publicKeyJwk = Map.of(JWK_KEK_TYPE, ecKey.getKeyType().toString(), JWK_CURVE, | ||
ecKey.getCurve().getName(), JWK_X, ecKey.getX().toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing JWK_Y for EC key. EC keys have both "x" and "y" parameters in their JWK representation.
import org.eclipse.tractusx.ssi.lib.model.did.*; | ||
import org.eclipse.tractusx.ssi.lib.model.did.Did; | ||
import org.eclipse.tractusx.ssi.lib.model.did.DidDocument; | ||
import org.eclipse.tractusx.ssi.lib.model.did.DidDocumentBuilder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import.
import org.springframework.transaction.support.TransactionCallbackWithoutResult; | ||
import org.springframework.transaction.support.TransactionTemplate; | ||
|
||
import java.io.StringWriter; | ||
import java.net.URI; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import
@andreibogus @aleksandra-bel some minor findings. |
Quality Gate passedIssues Measures |
🎉 This PR is included in version 0.5.0-develop.11 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 0.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This is implementation of Support ES256K/secp256k1
Closes: #266
Pre-review checks
Please ensure to do as many of the following checks as possible, before asking for committer review: