diff --git a/src/main/java/org/eclipse/tractusx/ssi/examples/VC.java b/src/main/java/org/eclipse/tractusx/ssi/examples/VC.java index 5756baaa..deda73e5 100644 --- a/src/main/java/org/eclipse/tractusx/ssi/examples/VC.java +++ b/src/main/java/org/eclipse/tractusx/ssi/examples/VC.java @@ -84,10 +84,8 @@ public static VerifiableCredential createVCWithoutProof() { */ public static VerifiableCredential createVCWithED25519Proof( VerifiableCredential credential, IPrivateKey privateKey, Did issuer) - throws UnsupportedSignatureTypeException, - InvalidPrivateKeyFormatException, - SignatureGenerateFailedException, - TransformJsonLdException { + throws UnsupportedSignatureTypeException, InvalidPrivateKeyFormatException, + SignatureGenerateFailedException, TransformJsonLdException { // VC Builder final VerifiableCredentialBuilder builder = @@ -127,10 +125,8 @@ public static VerifiableCredential createVCWithED25519Proof( */ public static VerifiableCredential createVCWithJWSProof( VerifiableCredential credential, IPrivateKey privateKey, Did issuer) - throws UnsupportedSignatureTypeException, - InvalidPrivateKeyFormatException, - SignatureGenerateFailedException, - TransformJsonLdException { + throws UnsupportedSignatureTypeException, InvalidPrivateKeyFormatException, + SignatureGenerateFailedException, TransformJsonLdException { // VC Builder final VerifiableCredentialBuilder builder = diff --git a/src/main/java/org/eclipse/tractusx/ssi/examples/Verification.java b/src/main/java/org/eclipse/tractusx/ssi/examples/Verification.java index 410ee001..8e90ef75 100644 --- a/src/main/java/org/eclipse/tractusx/ssi/examples/Verification.java +++ b/src/main/java/org/eclipse/tractusx/ssi/examples/Verification.java @@ -61,12 +61,8 @@ private Verification() { * @throws SignatureException the signature exception */ public static void verifyJWT(SignedJWT jwt) - throws DidParseException, - DidResolverException, - SignatureVerificationFailedException, - SignatureVerificationException, - SignatureParseException, - SignatureException { + throws DidParseException, DidResolverException, SignatureVerificationFailedException, + SignatureVerificationException, SignatureParseException, SignatureException { { // DID Resolver constructor params DidWebParser didParser = new DidWebParser(); @@ -94,13 +90,9 @@ public static void verifyJWT(SignedJWT jwt) * @throws SignatureVerificationFailedException the signature verification failed exception */ public static boolean verifyJWSLD(VerifiableCredential verifiableCredential) - throws TransformJsonLdException, - NoVerificationKeyFoundException, - UnsupportedSignatureTypeException, - InvalidPublicKeyFormatException, - SignatureParseException, - DidParseException, - SignatureVerificationFailedException { + throws TransformJsonLdException, NoVerificationKeyFoundException, + UnsupportedSignatureTypeException, InvalidPublicKeyFormatException, + SignatureParseException, DidParseException, SignatureVerificationFailedException { // DID Resolver constructor params DidWebParser didParser = new DidWebParser(); var httpClient = HttpClient.newHttpClient(); diff --git a/src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtVerifier.java b/src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtVerifier.java index e06b3706..8e13bc8e 100644 --- a/src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtVerifier.java +++ b/src/main/java/org/eclipse/tractusx/ssi/lib/jwt/SignedJwtVerifier.java @@ -70,12 +70,8 @@ public class SignedJwtVerifier { * @throws SignatureVerificationFailedException the signature verification failed exception */ public boolean verify(SignedJWT jwt) - throws DidParseException, - DidResolverException, - SignatureVerificationException, - SignatureParseException, - SignatureException, - SignatureVerificationFailedException { + throws DidParseException, DidResolverException, SignatureVerificationException, + SignatureParseException, SignatureException, SignatureVerificationFailedException { JWTClaimsSet jwtClaimsSet; try { diff --git a/src/main/java/org/eclipse/tractusx/ssi/lib/proof/IVerifier.java b/src/main/java/org/eclipse/tractusx/ssi/lib/proof/IVerifier.java index d3ee740a..2fd7209b 100644 --- a/src/main/java/org/eclipse/tractusx/ssi/lib/proof/IVerifier.java +++ b/src/main/java/org/eclipse/tractusx/ssi/lib/proof/IVerifier.java @@ -49,11 +49,7 @@ public interface IVerifier { * @throws NoVerificationKeyFoundException the no verification key found exception */ boolean verify(HashedLinkedData hashedLinkedData, Verifiable verifiable) - throws SignatureParseException, - DidParseException, - InvalidPublicKeyFormatException, - SignatureVerificationFailedException, - UnsupportedSignatureTypeException, - NoVerificationKeyFoundException; - + throws SignatureParseException, DidParseException, InvalidPublicKeyFormatException, + SignatureVerificationFailedException, UnsupportedSignatureTypeException, + NoVerificationKeyFoundException; } diff --git a/src/main/java/org/eclipse/tractusx/ssi/lib/proof/LinkedDataProofGenerator.java b/src/main/java/org/eclipse/tractusx/ssi/lib/proof/LinkedDataProofGenerator.java index 9040d312..44c0750d 100644 --- a/src/main/java/org/eclipse/tractusx/ssi/lib/proof/LinkedDataProofGenerator.java +++ b/src/main/java/org/eclipse/tractusx/ssi/lib/proof/LinkedDataProofGenerator.java @@ -86,8 +86,7 @@ public static LinkedDataProofGenerator newInstance(SignatureType type) * @throws InvalidePrivateKeyFormat the invalide private key format */ public Proof createProof(Verifiable verifiable, URI verificationMethodId, IPrivateKey privateKey) - throws InvalidPrivateKeyFormatException, - SignatureGenerateFailedException, + throws InvalidPrivateKeyFormatException, SignatureGenerateFailedException, TransformJsonLdException { Proof proof = null; diff --git a/src/main/java/org/eclipse/tractusx/ssi/lib/proof/LinkedDataProofValidation.java b/src/main/java/org/eclipse/tractusx/ssi/lib/proof/LinkedDataProofValidation.java index 50fd9c7b..e72063c0 100644 --- a/src/main/java/org/eclipse/tractusx/ssi/lib/proof/LinkedDataProofValidation.java +++ b/src/main/java/org/eclipse/tractusx/ssi/lib/proof/LinkedDataProofValidation.java @@ -92,13 +92,9 @@ public static LinkedDataProofValidation newInstance(DidResolver didResolver) { * @throws InvalidJsonLdException */ public boolean verify(Verifiable verifiable) - throws UnsupportedSignatureTypeException, - SignatureParseException, - DidParseException, - InvalidPublicKeyFormatException, - SignatureVerificationFailedException, - NoVerificationKeyFoundException, - TransformJsonLdException { + throws UnsupportedSignatureTypeException, SignatureParseException, DidParseException, + InvalidPublicKeyFormatException, SignatureVerificationFailedException, + NoVerificationKeyFoundException, TransformJsonLdException { var type = verifiable.getProof().getType(); IVerifier verifier = null; diff --git a/src/main/java/org/eclipse/tractusx/ssi/lib/proof/types/ed25519/Ed25519ProofVerifier.java b/src/main/java/org/eclipse/tractusx/ssi/lib/proof/types/ed25519/Ed25519ProofVerifier.java index 8557b4e0..5523258d 100644 --- a/src/main/java/org/eclipse/tractusx/ssi/lib/proof/types/ed25519/Ed25519ProofVerifier.java +++ b/src/main/java/org/eclipse/tractusx/ssi/lib/proof/types/ed25519/Ed25519ProofVerifier.java @@ -55,10 +55,8 @@ public class Ed25519ProofVerifier implements IVerifier { @SneakyThrows({DidResolverException.class}) public boolean verify(HashedLinkedData hashedLinkedData, Verifiable verifiable) - throws UnsupportedSignatureTypeException, - InvalidPublicKeyFormatException, - NoVerificationKeyFoundException, - DidParseException { + throws UnsupportedSignatureTypeException, InvalidPublicKeyFormatException, + NoVerificationKeyFoundException, DidParseException { final Proof proof = verifiable.getProof(); final Ed25519Signature2020 ed25519Signature2020 = new Ed25519Signature2020(proof); @@ -75,9 +73,7 @@ public boolean verify(HashedLinkedData hashedLinkedData, Verifiable verifiable) } private IPublicKey discoverPublicKey(Ed25519Signature2020 signature) - throws InvalidPublicKeyFormatException, - NoVerificationKeyFoundException, - DidResolverException, + throws InvalidPublicKeyFormatException, NoVerificationKeyFoundException, DidResolverException, DidParseException { final Did issuer = DidParser.parse(signature.getVerificationMethod()); diff --git a/src/main/java/org/eclipse/tractusx/ssi/lib/proof/types/jws/JWSProofVerifier.java b/src/main/java/org/eclipse/tractusx/ssi/lib/proof/types/jws/JWSProofVerifier.java index 40d78218..e44aa829 100644 --- a/src/main/java/org/eclipse/tractusx/ssi/lib/proof/types/jws/JWSProofVerifier.java +++ b/src/main/java/org/eclipse/tractusx/ssi/lib/proof/types/jws/JWSProofVerifier.java @@ -72,11 +72,8 @@ public class JWSProofVerifier implements IVerifier { */ @SneakyThrows({DidResolverException.class}) public boolean verify(HashedLinkedData hashedLinkedData, Verifiable document) - throws SignatureParseException, - DidParseException, - InvalidPublicKeyFormatException, - SignatureVerificationFailedException, - UnsupportedSignatureTypeException { + throws SignatureParseException, DidParseException, InvalidPublicKeyFormatException, + SignatureVerificationFailedException, UnsupportedSignatureTypeException { final Proof proof = document.getProof(); @@ -139,8 +136,7 @@ private OctetKeyPair discoverOctectKey(JWSSignature2020 signature) } public boolean verify(HashedLinkedData hashedLinkedData, byte[] signature, IPublicKey publicKey) - throws SignatureParseException, - SignatureVerificationFailedException, + throws SignatureParseException, SignatureVerificationFailedException, InvalidPublicKeyFormatException { var keyPair =