I have created public and private key using SubtleCrypto api. I am using webcrypto-shim to overcome some of the unimplemented methods of subtle in Safari. I am able to generate a keypair and sign my data with it.
Then I try to save my keypair on IndexedDB, it appears that my save transactions succeeded, no errors there. But when I want to use the public key again for signing, First I retrieve it from the IndexedDB and then I use SubtleCrypto.exportKey()
but it fails with an error
TypeError: Type error
I am trying to make it work on Safari desktop 9.1.2, I am also using IndexedDBShim
I suspect that the saving doesn't really work and my keys aren't being stored properly on IndexedDB. On the save transaction I save the keys without exporting them, meaning I am saving the object that I receviced from SubtleCrypto.generateKey()
.
Another thing is that the same code works on Chrome.