But is there any library available to write the generated RSA public key in DER format?
That would be similar to mbedtls_pk_write_pubkey_der in https://github.com/ARMmbed/mbedtls/blob/development/library/pkwrite.c
We expect the public key to be imported with https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#SubjectPublicKeyInfo