diff --git a/crypto/key/key.ts b/crypto/key/key.ts index a0a19cb5a7d..47d32932801 100644 --- a/crypto/key/key.ts +++ b/crypto/key/key.ts @@ -8,7 +8,7 @@ namespace $ { export class $mol_crypto_key extends $mol_buffer { - static from< This extends typeof $mol_crypto_key >( this: This, serial: string | Uint8Array ) { + static from< This extends typeof $mol_crypto_key >( this: This, serial: string | ArrayBufferView ) { if( typeof serial === 'string' ) { serial = new Uint8Array([ @@ -85,7 +85,7 @@ namespace $ { ) const { x, y, d } = await $mol_crypto_native.subtle.exportKey( 'jwk', pair.privateKey ) - return $mol_crypto_key_private.from( x + y! + d! ) + return this.from( x + y! + d! ) } diff --git a/crypto/key/key.web.test.ts b/crypto/key/key.web.test.ts index b34f54b559d..e73a027bb1f 100644 --- a/crypto/key/key.web.test.ts +++ b/crypto/key/key.web.test.ts @@ -1,7 +1,7 @@ namespace $ { $mol_test({ - async 'str sizes'() { + async 'str & bin sizes'() { const key_private = await $$.$mol_crypto_key_private.generate() const key_public = key_private.public()