Skip to content

Unable to get SignedJWT while trying to get VC from verifiedVP #3

Description

@mayurvashishtha

Hey Team,
I am trying to run the below code snippet

		for (Object vc : verifiedVp.getVerifiableCredentials()) {
			String vcToken = (String) vc;
			SignedJWT vcJwt = SignedJWT.parse(vcToken);
			VerifiableCredential verifiedVc;

			if (vcToken.equals(vc1)) {
				assertTrue(vcJwt.verify(new ECDSAVerifier(vc1PublicKey)));
				verifiedVc = new VerifiableCredential(vcJwt);
			} else if (vcToken.equals(vc2)) {
				assertTrue(vcJwt.verify(new ECDSAVerifier(vc2PublicKey)));
				verifiedVc = new VerifiableCredential(vcJwt);
			} else {
				continue;
			}

			assertNotNull(verifiedVc);
			System.out.println("vptest verified vc");
			System.out.println(verifiedVc.toJSONString());
		}

but I am getting below exception on this line "String vcToken = (String) vc;"
java.util.LinkedHashMap cannot be cast to java.lang.String
So, I am not able to get SignedJWT from vc Object.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions