@@ -279,7 +279,7 @@ async function testRSAEncryptionWrongKey({
279279 return assertThrowsAsync (
280280 async ( ) =>
281281 await subtle . encrypt ( algorithm , privateKey as CryptoKey , plaintext ) ,
282- 'The requested operation is not valid for the provided key ' ,
282+ 'InvalidAccessError ' ,
283283 ) ;
284284}
285285
@@ -301,7 +301,7 @@ async function testRSAEncryptionBadUsage({
301301 return assertThrowsAsync (
302302 async ( ) =>
303303 await subtle . encrypt ( algorithm , publicKey as CryptoKey , plaintext ) ,
304- 'The requested operation is not valid ' ,
304+ 'InvalidAccessError ' ,
305305 ) ;
306306}
307307
@@ -328,7 +328,7 @@ async function testRSADecryptionWrongKey({
328328 return assertThrowsAsync (
329329 async ( ) =>
330330 await subtle . decrypt ( algorithm , publicKey as CryptoKey , ciphertext ) ,
331- 'The requested operation is not valid ' ,
331+ 'InvalidAccessError ' ,
332332 ) ;
333333}
334334
@@ -355,7 +355,7 @@ async function testRSADecryptionBadUsage({
355355 return assertThrowsAsync (
356356 async ( ) =>
357357 await subtle . decrypt ( algorithm , publicKey as CryptoKey , ciphertext ) ,
358- 'The requested operation is not valid ' ,
358+ 'InvalidAccessError ' ,
359359 ) ;
360360}
361361
@@ -647,7 +647,7 @@ test(SUITE, 'ChaCha20-Poly1305 wrong key usage encrypt', async () => {
647647 key as CryptoKey ,
648648 getRandomValues ( new Uint8Array ( 32 ) ) ,
649649 ) ,
650- 'The requested operation is not valid for the provided key ' ,
650+ 'InvalidAccessError ' ,
651651 ) ;
652652} ) ;
653653
@@ -674,7 +674,7 @@ test(SUITE, 'ChaCha20-Poly1305 wrong key usage decrypt', async () => {
674674 key as CryptoKey ,
675675 ciphertext ,
676676 ) ,
677- 'The requested operation is not valid for the provided key ' ,
677+ 'InvalidAccessError ' ,
678678 ) ;
679679} ) ;
680680
@@ -936,7 +936,7 @@ async function testAESEncryptNoEncrypt({
936936
937937 await assertThrowsAsync (
938938 async ( ) => await subtle . encrypt ( algorithm , key , plaintext ) ,
939- 'The requested operation is not valid for the provided key ' ,
939+ 'InvalidAccessError ' ,
940940 ) ;
941941}
942942
@@ -962,7 +962,7 @@ async function testAESEncryptNoDecrypt({
962962
963963 await assertThrowsAsync (
964964 async ( ) => await subtle . decrypt ( algorithm , key , output ) ,
965- 'The requested operation is not valid for the provided key ' ,
965+ 'InvalidAccessError ' ,
966966 ) ;
967967}
968968
@@ -982,7 +982,7 @@ async function testAESEncryptWrongAlg(
982982
983983 await assertThrowsAsync (
984984 async ( ) => await subtle . encrypt ( algorithm , key , plaintext ) ,
985- 'The requested operation is not valid for the provided key ' ,
985+ 'InvalidAccessError ' ,
986986 ) ;
987987}
988988
0 commit comments