Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix for DDCCGW-593 AND DDCCGW-667 #40

Merged
merged 4 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ private String generateTrustList(DidSpecification specification, boolean onlyRef

// Add Trusted Issuer (DID References)
// TODO: Add filtering for TrustedIssuers
trustedIssuerEntities.forEach(did -> trustList.getVerificationMethod().add(did.getUrl()));
if (onlyReferences) {
trustedIssuerEntities.forEach(did -> trustList.getVerificationMethod().add(did.getUrl()));
}

// Sign Document
JsonWebSignature2020LdSigner signer = new JsonWebSignature2020LdSigner(byteSigner);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ public static class EcPublicKeyJwk extends PublicKeyJwk {
*/
public EcPublicKeyJwk(ECPublicKey ecPublicKey, List<String> base64EncodedCertificates) {
super("EC", base64EncodedCertificates);
valueX = Base64.getUrlEncoder().encodeToString(ecPublicKey.getW().getAffineX().toByteArray());
valueY = Base64.getUrlEncoder().encodeToString(ecPublicKey.getW().getAffineY().toByteArray());
valueX = Base64.getUrlEncoder().withoutPadding()
.encodeToString(ecPublicKey.getW().getAffineX().toByteArray());
valueY = Base64.getUrlEncoder().withoutPadding()
.encodeToString(ecPublicKey.getW().getAffineY().toByteArray());

ECNamedCurveSpec curveSpec = (ECNamedCurveSpec) ecPublicKey.getParams();
switch (curveSpec.getName()) {
Expand Down Expand Up @@ -118,7 +120,8 @@ public static class RsaPublicKeyJwk extends PublicKeyJwk {
*/
public RsaPublicKeyJwk(RSAPublicKey rsaPublicKey, List<String> base64EncodedCertificates) {
super("RSA", base64EncodedCertificates);
valueN = Base64.getUrlEncoder().encodeToString(rsaPublicKey.getModulus().toByteArray());
valueN = Base64.getUrlEncoder().withoutPadding()
.encodeToString(rsaPublicKey.getModulus().toByteArray());
valueE = Base64.getUrlEncoder().encodeToString(rsaPublicKey.getPublicExponent().toByteArray());
}
}
Expand Down
Loading
Loading