Skip to content

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

Description

@kenneth-leong-gt

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

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