diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2023-04-06 18:39:25 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-06 18:39:25 +0530 |
commit | 3b62a58818f83e32fc2644f44e75a5c8465b2003 (patch) | |
tree | cf8f0a6d7995fa0c632247f2679295b8ceea4460 /ext/node/polyfills/internal/crypto/keys.ts | |
parent | 339165bd9565806374fa842dfc217dcc5ebabac5 (diff) |
fix(ext/node): add symmetric keygen (#18609)
Towards #18455
Diffstat (limited to 'ext/node/polyfills/internal/crypto/keys.ts')
-rw-r--r-- | ext/node/polyfills/internal/crypto/keys.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/node/polyfills/internal/crypto/keys.ts b/ext/node/polyfills/internal/crypto/keys.ts index eb7990b06..ef2aba737 100644 --- a/ext/node/polyfills/internal/crypto/keys.ts +++ b/ext/node/polyfills/internal/crypto/keys.ts @@ -279,7 +279,7 @@ export function prepareSecretKey( return getArrayBufferOrView(key, "key", encoding); } -class SecretKeyObject extends KeyObject { +export class SecretKeyObject extends KeyObject { constructor(handle: unknown) { super("secret", handle); } @@ -313,7 +313,7 @@ class SecretKeyObject extends KeyObject { } } -function setOwnedKey(key: Uint8Array): unknown { +export function setOwnedKey(key: Uint8Array): unknown { const handle = {}; KEY_STORE.set(handle, key); return handle; @@ -345,4 +345,6 @@ export default { isCryptoKey, KeyObject, prepareSecretKey, + setOwnedKey, + SecretKeyObject, }; |