PeculiarVentures / webcrypto-local

webcrypto-local is a cross platform service that provides access to PKCS#11 implementations over a protocol we call webcrypto-socket.
https://peculiarventures.github.io/webcrypto-local/
MIT License
18 stars 13 forks source link

RSA-OAEP key signing error #263

Open bunyaminatik opened 2 years ago

bunyaminatik commented 2 years ago

Hi,

I have a smart card that has rsa key pairs and Qualified certificate. But rsa key type is RSA-OAEP. When I try to sign with this key, it returns 'key does not match that of operation'. Because key usages returns empty. But I can use this key in bouncy castle on java for signing.

How could we solve that. Please help me.

image

bunyaminatik commented 2 years ago

Key information also here from javascript console.

image

microshine commented 2 years ago

@bunyaminatik Please try to get the private key from the storage with a signing mechanism

const alg = {
  name: "RSASSA-PKCS1-v1_5",
  hash: "SHA-256",
};
const privateKey = await provider.keyStorage.getItem("<private key id>", alg, false, ["sign"]);