Trying different jwk props for ECDH key imports

This commit is contained in:
mhelander 2018-02-19 22:09:19 +02:00
parent 5abdc308ed
commit 0ca9058430

4
sea.js
View File

@ -500,12 +500,12 @@
const ecdhSubtle = ossl || subtle
const keysToEcdhJwk = (pub, d) => { // d === priv
const [ x, y ] = Buffer.from(pub, 'base64').toString('utf8').split(':')
const key_ops = [ `${d ? 'de' : 'en'}crypt`, 'deriveKey' ]
const key_ops = [ `${d ? 'de' : 'en'}crypt` /*, 'deriveKey' */ ]
const jwk = d ? { d, key_ops } : { key_ops }
return Object.assign(jwk, {
kty: 'EC',
crv: 'P-256',
ext: false,
ext: true,
x,
y
})