Skip to content

Commit

Permalink
fix: exception names
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafasalfiti authored and nitin-vavdiya committed May 14, 2024
1 parent 1b260fa commit 61832ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.eclipse.tractusx.managedidentitywallets.exception.*;
import org.eclipse.tractusx.ssi.lib.exception.NoVerificationKeyFoundExcpetion;
import org.eclipse.tractusx.ssi.lib.exception.proof.NoVerificationKeyFoundException;
import org.springframework.data.mapping.PropertyReferenceException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ProblemDetail;
Expand Down Expand Up @@ -205,8 +205,8 @@ ProblemDetail handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismat
* @param exception the exception
* @return the problem detail
*/
@ExceptionHandler(NoVerificationKeyFoundExcpetion.class)
ProblemDetail handleNoVerificationKeyFoundException(NoVerificationKeyFoundExcpetion exception) {
@ExceptionHandler(NoVerificationKeyFoundException.class)
ProblemDetail handleNoVerificationKeyFoundException(NoVerificationKeyFoundException exception) {
ProblemDetail problemDetail = ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, ExceptionUtils.getMessage(exception));
problemDetail.setTitle(ExceptionUtils.getMessage(exception));
problemDetail.setProperty(TIMESTAMP, System.currentTimeMillis());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import org.eclipse.tractusx.managedidentitywallets.interfaces.SecureTokenIssuer;
import org.eclipse.tractusx.managedidentitywallets.utils.EncryptionUtils;
import org.eclipse.tractusx.ssi.lib.crypt.octet.OctetKeyPairFactory;
import org.eclipse.tractusx.ssi.lib.crypt.x21559.x21559PrivateKey;
import org.eclipse.tractusx.ssi.lib.crypt.x25519.x25519PrivateKey;
import org.springframework.stereotype.Component;

import java.time.Instant;
Expand Down Expand Up @@ -103,7 +103,7 @@ private JWT createSignedJWT(KeyPair keyPair, JWTClaimsSet.Builder builder) {
SignedJWT signedJWT = new SignedJWT(header, body);
String privateKey = encryptionUtils.decrypt(keyPair.privateKey());
// todo bri: this should become dynamic in the future, as we want to support more key algos.
OctetKeyPair jwk = new OctetKeyPairFactory().fromPrivateKey(new x21559PrivateKey(privateKey, true));
OctetKeyPair jwk = new OctetKeyPairFactory().fromPrivateKey(new x25519PrivateKey(privateKey, true));
Ed25519Signer signer = new Ed25519Signer(jwk);
signedJWT.sign(signer);
log.debug("JWT signed for issuer '{}' and holder '{}'", builder.getClaims().get("iss"),
Expand Down

0 comments on commit 61832ed

Please sign in to comment.