swc/bundler/tests/.cache/deno/23757f2a45edf09f858ba2b3dd6b3d1ca9908dc2.ts
강동윤 bbaf619f63
fix(bundler): Fix bugs (#1437)
swc_bundler:
 - [x] Fix wrapped esms. (denoland/deno#9307)
 - [x] Make test secure.
2021-03-02 17:33:03 +09:00

11 lines
325 B
TypeScript

// Loaded from https://deno.land/x/mysql/src/auth_plugin/crypt.ts
import { RSA } from "https://deno.land/x/god_crypto@v0.2.0/mod.ts";
function encryptWithPublicKey(key: string, data: Uint8Array): Uint8Array {
const publicKey = RSA.parseKey(key);
return RSA.encrypt(data, publicKey);
}
export { encryptWithPublicKey };