implemented frontend including separate message system; started to implement backend
This commit is contained in:
19
yjs-poll/node_modules/lib0/crypto/common.js
generated
vendored
Normal file
19
yjs-poll/node_modules/lib0/crypto/common.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import * as webcrypto from 'lib0/webcrypto'
|
||||
|
||||
/**
|
||||
* @param {CryptoKey} key
|
||||
*/
|
||||
export const exportKeyJwk = async key => {
|
||||
const jwk = await webcrypto.subtle.exportKey('jwk', key)
|
||||
jwk.key_ops = key.usages
|
||||
return jwk
|
||||
}
|
||||
|
||||
/**
|
||||
* Only suited for exporting public keys.
|
||||
*
|
||||
* @param {CryptoKey} key
|
||||
* @return {Promise<Uint8Array<ArrayBuffer>>}
|
||||
*/
|
||||
export const exportKeyRaw = key =>
|
||||
webcrypto.subtle.exportKey('raw', key).then(key => new Uint8Array(key))
|
||||
Reference in New Issue
Block a user