First upload version 0.0.1

This commit is contained in:
Neyra
2026-02-05 15:27:49 +08:00
commit 8e9b7201ed
4182 changed files with 593136 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
// this can be removed once we only support Node 20+
export { subtle } from "node:crypto";
import { createPrivateKey } from "node:crypto";
import { isPkcs1 } from "./utils.js";
// no-op, unfortunately there is no way to transform from PKCS8 or OpenSSH to PKCS1 with WebCrypto
export function convertPrivateKey(privateKey) {
if (!isPkcs1(privateKey)) return privateKey;
return createPrivateKey(privateKey).export({
type: "pkcs8",
format: "pem",
});
}