diff --git a/lib/src/dpop/dpop_signer_native.dart b/lib/src/dpop/dpop_signer_native.dart index 975e404..14a571f 100644 --- a/lib/src/dpop/dpop_signer_native.dart +++ b/lib/src/dpop/dpop_signer_native.dart @@ -40,5 +40,4 @@ Future signRs256( String signingInput, String privateKeyPem, String publicExponent, -) async => - signRs256Sync(signingInput, privateKeyPem); +) async => signRs256Sync(signingInput, privateKeyPem); diff --git a/lib/src/dpop/dpop_signer_web.dart b/lib/src/dpop/dpop_signer_web.dart index 7166d43..f0ea269 100644 --- a/lib/src/dpop/dpop_signer_web.dart +++ b/lib/src/dpop/dpop_signer_web.dart @@ -97,8 +97,10 @@ Future signRs256( String privateKeyPem, String publicExponent, ) async { - final key = - await (_keys[privateKeyPem] ??= _importKey(privateKeyPem, publicExponent)); + final key = await (_keys[privateKeyPem] ??= _importKey( + privateKeyPem, + publicExponent, + )); final signature = await web.window.crypto.subtle .sign(_algorithm, key, Uint8List.fromList(utf8.encode(signingInput)).toJS) .toDart; diff --git a/test/dpop_token_generator_test.dart b/test/dpop_token_generator_test.dart index f211189..f558626 100644 --- a/test/dpop_token_generator_test.dart +++ b/test/dpop_token_generator_test.dart @@ -145,9 +145,15 @@ void main() { ); // RS256 is deterministic: same key and input, same signature. - expect(await signRs256(input, _pem), signRs256Sync(input, _pem)); + expect( + await signRs256(input, _pem, _jwk['e'] as String), + signRs256Sync(input, _pem), + ); // And again, from the cached key. - expect(await signRs256(input, _pem), signRs256Sync(input, _pem)); + expect( + await signRs256(input, _pem, _jwk['e'] as String), + signRs256Sync(input, _pem), + ); }); }