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

Determining algorithm value when using PublicKeyVerifierFactory.publicKeyVerifierForJWK() #20

Open
kenneth-leong-gt opened this issue May 5, 2023 · 0 comments

Comments

@kenneth-leong-gt
Copy link

Hi currently i am creating my verifier like below.


val jsonLdObject =  getJsonLDObjectFromString(jsonLdString)
val ldProof = LdProof.getFromJsonLDObject(jsonLdObject)

val verifier =
            try {
                LdVerifierRegistry.getLdVerifierBySignatureSuiteTerm(ldProof.type)
            } catch (ex: Exception) {
                Log.d("webOfTrustVerifyJsonLd", "Unable to get verifier: ${ex::class.java.simpleName} - ${ex.message}")
                null
            } 

After creating the verifier i understand that the publicKeyVerifier needs to be created. I have the publicKey JWK.
My questions is, what is the way to determine the algorithm String when creating the PublicKeyVerifier below?
My JWK alg is null.

val parsedJwk = JWK.fromJson(publicJwkJsonObject.toString().replace("\\", ""))
val byteVerifier = PublicKeyVerifierFactory.publicKeyVerifierForJWK(parsedJwk, "some Algorithm")  <----- here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant