node-jose icon indicating copy to clipboard operation
node-jose copied to clipboard

Can this package convert a Uint8Array to JWK object

Open abhijithvijayan opened this issue 5 years ago • 1 comments

Is it possible for a Uint8Array to be set with the structure of a JWK object using this library in browser

Input:

Uint8Array(32) [16, 242, 193, 235, 85, 252, 66, 94, 118, 129, 203, 86, 48, 212, 115, 194, 174, 233, 55, 141, 48, 208, 236, 48, 85, 16, 161, 166, 145, 172, 53, 82]

produce output like:

KCVXrFs8oJBheco-JxbHkPL9bxyN5\WZ68hyfVgrBuJg

The whole expected output is something like

{ 
”alg”:”A256GCM”,
”ext”:false,
”k”:”KCVXrFs8oJBheco-JxbHkPL9bxyN5\WZ68hyfVgrBuJg”,
”key_ops”:[”encrypt”,”decrypt”],
”kty”:”oct”,
”kid”:”mp”
}

All the fields are not necessary.

abhijithvijayan avatar Jun 22 '19 12:06 abhijithvijayan