mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-09 20:12:10 +10:00
16 lines
442 B
TypeScript
16 lines
442 B
TypeScript
import { CertificateAuthority } from "../internal/clients/ca";
|
|
import { dbCertificateStore } from "../internal/clients/ca-store";
|
|
|
|
let ca: CertificateAuthority | undefined;
|
|
|
|
export const useCertificateAuthority = () => {
|
|
if (!ca) throw new Error("CA not initialised");
|
|
return ca;
|
|
};
|
|
|
|
export default defineNitroPlugin(async () => {
|
|
// const store = fsCertificateStore();
|
|
|
|
ca = await CertificateAuthority.new(dbCertificateStore());
|
|
});
|