Skip to content

Commit

Permalink
fix: spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin-vavdiya committed Apr 17, 2024
1 parent e05eee5 commit 81408ff
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 57 deletions.
12 changes: 4 additions & 8 deletions src/main/java/org/eclipse/tractusx/ssi/examples/VC.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down
18 changes: 5 additions & 13 deletions src/main/java/org/eclipse/tractusx/ssi/examples/Verification.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/org/eclipse/tractusx/ssi/lib/proof/IVerifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 81408ff

Please sign in to comment.