import { DEFAULT_CONFIG } from "@goauthentik/common/api/config"; import { Form } from "@goauthentik/elements/forms/Form"; import "@goauthentik/elements/forms/HorizontalFormElement"; import { msg } from "@lit/localize"; import { TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; import { AlgEnum, CertificateGenerationRequest, CertificateKeyPair, CryptoApi, } from "@goauthentik/api"; @customElement("ak-crypto-certificate-generate-form") export class CertificateKeyPairForm extends Form { getSuccessMessage(): string { return msg("Successfully generated certificate-key pair."); } async send(data: CertificateGenerationRequest): Promise { return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsGenerateCreate({ certificateGenerationRequest: data, }); } renderForm(): TemplateResult { return html`

${msg("Optional, comma-separated SubjectAlt Names.")}

${msg("Algorithm used to generate the private key.")}

`; } }