Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Address PR comments
Carlos Monastyrskie70adc91a9f4
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.tsindex 76159e9734..d85d64fabf 100644--- a/backend/src/lib/api-docs/constants.ts+++ b/backend/src/lib/api-docs/constants.ts@@ -2561,7 +2561,8 @@ export const KMS = {projectId: "The ID of the project to create the key in.",name: "The name of the key to be created. Must be slug-friendly.",description: "An optional description of the key.",- encryptionAlgorithm: "The algorithm to use when performing cryptographic operations with the key.",+ algorithm: "The cryptographic algorithm of the key (e.g. aes-256-gcm, RSA_4096, HMAC_SHA_256).",+ encryptionAlgorithm: "Deprecated: use 'algorithm' instead. Retained as an alias for backwards compatibility.",type: "The type of key to be created, either encrypt-decrypt or sign-verify, based on your intended use for the key.",isExportable:"Whether the raw key material can be exported after creation. When set to false, the key can never be exported regardless of permissions. This cannot be changed after creation."diff --git a/backend/src/server/routes/v1/cmek-router.ts b/backend/src/server/routes/v1/cmek-router.tsindex 3bfdc20442..05ff353c52 100644--- a/backend/src/server/routes/v1/cmek-router.ts+++ b/backend/src/server/routes/v1/cmek-router.ts@@ -26,8 +26,15 @@ const AllowedKmsKeyAlgorithms = [...Object.values(HmacAlgorithm)] as [string, ...string[]];-const CmekSchema = KmsKeysSchema.merge(InternalKmsSchema.pick({ version: true, encryptionAlgorithm: true })).omit({- isReserved: true+const CmekSchema = KmsKeysSchema.merge(InternalKmsSchema.pick({ version: true, encryptionAlgorithm: true }))+ .omit({+ isReserved: true+ })+ .extend({ algorithm: z.string() });++const withAlgorithmAlias = <T extends { encryptionAlgorithm: string }>(key: T) => ({+ ...key,+ algorithm: key.encryptionAlgorithm});const MAX_KMS_PAYLOAD_BYTES = 1024 * 1024;@@ -84,43 +91,42 @@ export const registerCmekRouter = async (server: FastifyZodProvider) => {.optional().default(KmsKeyUsage.ENCRYPT_DECRYPT).describe(KMS.CREATE_KEY.type),- encryptionAlgorithm: z- .enum(AllowedKmsKeyAlgorithms)- .optional()- .default(SymmetricKeyAlgorithm.AES_GCM_256)- .describe(KMS.CREATE_KEY.encryptionAlgorithm),+ algorithm: z.enum(AllowedKmsKeyAlgorithms).optional().describe(KMS.CREATE_KEY.algorithm),+ // Deprecated alias for `algorithm`, retained for backwards compatibility.+ encryptionAlgorithm: z.enum(AllowedKmsKeyAlgorithms).optional().describe(KMS.CREATE_KEY.encryptionAlgorithm),isExportable: z.boolean().optional().default(true).describe(KMS.CREATE_KEY.isExportable)}).superRefine((data, ctx) => {+ const algorithm = data.algorithm ?? data.encryptionAlgorithm ?? SymmetricKeyAlgorithm.AES_GCM_256;if (data.keyUsage === KmsKeyUsage.ENCRYPT_DECRYPT &&- !Object.values(SymmetricKeyAlgorithm).includes(data.encryptionAlgorithm as SymmetricKeyAlgorithm)+ !Object.values(SymmetricKeyAlgorithm).includes(algorithm as SymmetricKeyAlgorithm)) {ctx.addIssue({code: z.ZodIssueCode.custom,- message: `encryptionAlgorithm must be a valid symmetric encryption algorithm. Valid options are: ${Object.values(+ message: `algorithm must be a valid symmetric encryption algorithm. Valid options are: ${Object.values(SymmetricKeyAlgorithm).join(", ")}`});}if (data.keyUsage === KmsKeyUsage.SIGN_VERIFY &&- !Object.values(AsymmetricKeyAlgorithm).includes(data.encryptionAlgorithm as AsymmetricKeyAlgorithm)+ !Object.values(AsymmetricKeyAlgorithm).includes(algorithm as AsymmetricKeyAlgorithm)) {ctx.addIssue({code: z.ZodIssueCode.custom,- message: `encryptionAlgorithm must be a valid asymmetric sign-verify algorithm. Valid options are: ${Object.values(+ message: `algorithm must be a valid asymmetric sign-verify algorithm. Valid options are: ${Object.values(AsymmetricKeyAlgorithm).join(", ")}`});}if (data.keyUsage === KmsKeyUsage.GENERATE_VERIFY_MAC &&- !Object.values(HmacAlgorithm).includes(data.encryptionAlgorithm as HmacAlgorithm)+ !Object.values(HmacAlgorithm).includes(algorithm as HmacAlgorithm)) {ctx.addIssue({code: z.ZodIssueCode.custom,- message: `encryptionAlgorithm must be a valid HMAC algorithm. Valid options are: ${Object.values(+ message: `algorithm must be a valid HMAC algorithm. Valid options are: ${Object.values(HmacAlgorithm).join(", ")}`});@@ -135,17 +141,21 @@ export const registerCmekRouter = async (server: FastifyZodProvider) => {onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),handler: async (req) => {const {- body: { projectId, name, description, encryptionAlgorithm, keyUsage, isExportable },+ body: { projectId, name, description, keyUsage, isExportable },permission} = req;+ const algorithm = (req.body.algorithm ??+ req.body.encryptionAlgorithm ??+ SymmetricKeyAlgorithm.AES_GCM_256) as TCmekKeyEncryptionAlgorithm;+const cmek = await server.services.cmek.createCmek({orgId: permission.orgId,projectId,name,description,- encryptionAlgorithm: encryptionAlgorithm as TCmekKeyEncryptionAlgorithm,+ encryptionAlgorithm: algorithm,keyUsage,isExportable},@@ -161,7 +171,7 @@ export const registerCmekRouter = async (server: FastifyZodProvider) => {keyId: cmek.id,name,description,- encryptionAlgorithm: encryptionAlgorithm as TCmekKeyEncryptionAlgorithm,+ encryptionAlgorithm: algorithm,isExportable}}@@ -175,13 +185,13 @@ export const registerCmekRouter = async (server: FastifyZodProvider) => {properties: {keyId: cmek.id,projectId,- encryptionAlgorithm,+ encryptionAlgorithm: algorithm,keyUsage}}).catch(() => {});- return { key: cmek };+ return { key: withAlgorithmAlias(cmek) };}});@@ -233,7 +243,7 @@ export const registerCmekRouter = async (server: FastifyZodProvider) => {}});- return { key: cmek };+ return { key: withAlgorithmAlias(cmek) };}});@@ -279,7 +289,7 @@ export const registerCmekRouter = async (server: FastifyZodProvider) => {}});- return { key: cmek };+ return { key: withAlgorithmAlias(cmek) };}});@@ -324,7 +334,7 @@ export const registerCmekRouter = async (server: FastifyZodProvider) => {}});- return { key: cmek };+ return { key: withAlgorithmAlias(cmek) };}});@@ -379,7 +389,7 @@ export const registerCmekRouter = async (server: FastifyZodProvider) => {}});- return { keys: cmeks, totalCount };+ return { keys: cmeks.map(withAlgorithmAlias), totalCount };}});@@ -423,7 +433,7 @@ export const registerCmekRouter = async (server: FastifyZodProvider) => {}});- return { key };+ return { key: withAlgorithmAlias(key) };}});@@ -471,7 +481,7 @@ export const registerCmekRouter = async (server: FastifyZodProvider) => {}});- return { key };+ return { key: withAlgorithmAlias(key) };}});@@ -643,36 +653,47 @@ export const registerCmekRouter = async (server: FastifyZodProvider) => {.object({name: keyNameSchema,keyUsage: z.nativeEnum(KmsKeyUsage),- encryptionAlgorithm: z.enum(AllowedKmsKeyAlgorithms),+ algorithm: z.enum(AllowedKmsKeyAlgorithms).optional(),+ // Deprecated alias for `algorithm`, retained for backwards compatibility.+ encryptionAlgorithm: z.enum(AllowedKmsKeyAlgorithms).optional(),keyMaterial: z.string().min(1),isExportable: z.boolean().optional().default(true).describe(KMS.CREATE_KEY.isExportable)}).superRefine((data, ctx) => {+ const algorithm = data.algorithm ?? data.encryptionAlgorithm;+ if (!algorithm) {+ ctx.addIssue({+ code: z.ZodIssueCode.custom,+ path: ["algorithm"],+ message: "algorithm is required"+ });+ return;+ }if (data.keyUsage === KmsKeyUsage.ENCRYPT_DECRYPT &&- !Object.values(SymmetricKeyAlgorithm).includes(data.encryptionAlgorithm as SymmetricKeyAlgorithm)+ !Object.values(SymmetricKeyAlgorithm).includes(algorithm as SymmetricKeyAlgorithm)) {ctx.addIssue({code: z.ZodIssueCode.custom,- message: `encryptionAlgorithm must be a symmetric algorithm for encrypt-decrypt keys`+ message: `algorithm must be a symmetric algorithm for encrypt-decrypt keys`});}if (data.keyUsage === KmsKeyUsage.SIGN_VERIFY &&- !Object.values(AsymmetricKeyAlgorithm).includes(data.encryptionAlgorithm as AsymmetricKeyAlgorithm)+ !Object.values(AsymmetricKeyAlgorithm).includes(algorithm as AsymmetricKeyAlgorithm)) {ctx.addIssue({code: z.ZodIssueCode.custom,- message: `encryptionAlgorithm must be an asymmetric algorithm for sign-verify keys`+ message: `algorithm must be an asymmetric algorithm for sign-verify keys`});}if (data.keyUsage === KmsKeyUsage.GENERATE_VERIFY_MAC &&- !Object.values(HmacAlgorithm).includes(data.encryptionAlgorithm as HmacAlgorithm)+ !Object.values(HmacAlgorithm).includes(algorithm as HmacAlgorithm)) {ctx.addIssue({code: z.ZodIssueCode.custom,- message: `encryptionAlgorithm must be an HMAC algorithm for generate-verify-mac keys`+ message: `algorithm must be an HMAC algorithm for generate-verify-mac keys`});}if (!isBase64(data.keyMaterial)) {@@ -706,7 +727,7 @@ export const registerCmekRouter = async (server: FastifyZodProvider) => {projectId,keys: keys.map((k) => ({name: k.name,- algorithm: k.encryptionAlgorithm as TCmekKeyEncryptionAlgorithm,+ algorithm: (k.algorithm ?? k.encryptionAlgorithm)! as TCmekKeyEncryptionAlgorithm,keyUsage: k.keyUsage,keyMaterial: k.keyMaterial,isExportable: k.isExportablediff --git a/docs/documentation/platform/kms/overview.mdx b/docs/documentation/platform/kms/overview.mdxindex 98dcc61a7b..8cf32747fb 100644--- a/docs/documentation/platform/kms/overview.mdx+++ b/docs/documentation/platform/kms/overview.mdx@@ -86,7 +86,7 @@ In the following steps, we explore how to generate a key and use it to encrypt d"projectId": "<project-id>","name": "my-secret-key","description": "...",- "encryptionAlgorithm": "aes-256-gcm"+ "algorithm": "aes-256-gcm"}'```diff --git a/docs/internals/permissions/project-permissions.mdx b/docs/internals/permissions/project-permissions.mdxindex 10b8d276f1..020f274679 100644--- a/docs/internals/permissions/project-permissions.mdx+++ b/docs/internals/permissions/project-permissions.mdx@@ -323,6 +323,8 @@ Supports conditions and permission inversion.| `decrypt` | Use keys for decryption operations || `sign` | Use keys for signing operations || `verify` | Use keys for signature verification operations |+| `generate-mac` | Use keys to generate message authentication codes (MACs) |+| `verify-mac` | Use keys to verify message authentication codes (MACs) || `rotate` | Rotate key material for encryption keys || `export-private-key` | Export key material (private key for asymmetric, secret key for symmetric) |diff --git a/frontend/src/helpers/kms.ts b/frontend/src/helpers/kms.tsindex b1ea08f978..1511b9435b 100644--- a/frontend/src/helpers/kms.ts+++ b/frontend/src/helpers/kms.ts@@ -40,10 +40,10 @@ export const keyUsageDefaultOption: Record<};export const getDefaultSigningAlgorithm = (cmek: TCmek): SigningAlgorithm => {- if (cmek?.encryptionAlgorithm?.startsWith("ML_DSA")) {- return cmek.encryptionAlgorithm as unknown as SigningAlgorithm;+ if (cmek?.algorithm?.startsWith("ML_DSA")) {+ return cmek.algorithm as unknown as SigningAlgorithm;}- if (cmek?.encryptionAlgorithm?.startsWith("RSA")) {+ if (cmek?.algorithm?.startsWith("RSA")) {return SigningAlgorithm.RSASSA_PSS_SHA_512;}return SigningAlgorithm.ECDSA_SHA_256;diff --git a/frontend/src/hooks/api/cmeks/types.ts b/frontend/src/hooks/api/cmeks/types.tsindex e89a5c9f4f..a6be94c7b6 100644--- a/frontend/src/hooks/api/cmeks/types.ts+++ b/frontend/src/hooks/api/cmeks/types.ts@@ -13,7 +13,7 @@ export type TCmek = {keyUsage: KmsKeyUsage;name: string;description?: string;- encryptionAlgorithm: AsymmetricKeyAlgorithm | SymmetricKeyAlgorithm | HmacAlgorithm;+ algorithm: AsymmetricKeyAlgorithm | SymmetricKeyAlgorithm | HmacAlgorithm;projectId: string;isDisabled: boolean;isReserved: boolean;@@ -27,7 +27,7 @@ export type TCmek = {type ProjectRef = { projectId: string };type KeyRef = { keyId: string };-export type TCreateCmek = Pick<TCmek, "name" | "description" | "encryptionAlgorithm" | "keyUsage"> &+export type TCreateCmek = Pick<TCmek, "name" | "description" | "algorithm" | "keyUsage"> &Partial<Pick<TCmek, "isExportable">> &ProjectRef;export type TUpdateCmek = KeyRef &@@ -131,7 +131,7 @@ export type TCmekBulkExportPrivateKeysResponse = {export type TCmekBulkImportKeyEntry = {name: string;keyUsage: KmsKeyUsage;- encryptionAlgorithm: AsymmetricKeyAlgorithm | SymmetricKeyAlgorithm | HmacAlgorithm;+ algorithm: AsymmetricKeyAlgorithm | SymmetricKeyAlgorithm | HmacAlgorithm;keyMaterial: string;isExportable?: boolean;};diff --git a/frontend/src/pages/kms/OverviewPage/components/CmekBulkImportModal.tsx b/frontend/src/pages/kms/OverviewPage/components/CmekBulkImportModal.tsxindex c0262e3a55..488fe29736 100644--- a/frontend/src/pages/kms/OverviewPage/components/CmekBulkImportModal.tsx+++ b/frontend/src/pages/kms/OverviewPage/components/CmekBulkImportModal.tsx@@ -279,7 +279,7 @@ export const CmekBulkImportModal = ({ isOpen, onOpenChange, projectId }: Props)keys: parsedKeys.map((k) => ({name: k.name,keyUsage: k.keyType,- encryptionAlgorithm: k.algorithm as never,+ algorithm: k.algorithm as never,keyMaterial:k.keyType === KmsKeyUsage.SIGN_VERIFY ? (k.privateKey ?? "") : (k.keyMaterial ?? ""),isExportable: k.isExportablediff --git a/frontend/src/pages/kms/OverviewPage/components/CmekExportKeyModal.tsx b/frontend/src/pages/kms/OverviewPage/components/CmekExportKeyModal.tsxindex a98d8fd889..397f726168 100644--- a/frontend/src/pages/kms/OverviewPage/components/CmekExportKeyModal.tsx+++ b/frontend/src/pages/kms/OverviewPage/components/CmekExportKeyModal.tsx@@ -23,7 +23,7 @@ type FormProps = Pick<Props, "cmek">;const ExportKeyForm = ({ cmek }: FormProps) => {const { permission } = useProjectPermission();const isAsymmetricKey = Object.values(AsymmetricKeyAlgorithm).includes(- cmek?.encryptionAlgorithm as AsymmetricKeyAlgorithm+ cmek?.algorithm as AsymmetricKeyAlgorithm);const canReadPublicKey = permission.can(diff --git a/frontend/src/pages/kms/OverviewPage/components/CmekModal.tsx b/frontend/src/pages/kms/OverviewPage/components/CmekModal.tsxindex c56f3ae3da..fa7e859c01 100644--- a/frontend/src/pages/kms/OverviewPage/components/CmekModal.tsx+++ b/frontend/src/pages/kms/OverviewPage/components/CmekModal.tsx@@ -39,7 +39,7 @@ import { slugSchema } from "@app/lib/schemas";const formSchema = z.object({name: slugSchema({ min: 1, max: 32, field: "Name" }),description: z.string().max(500).optional(),- encryptionAlgorithm: z.enum(AllowedEncryptionKeyAlgorithms),+ algorithm: z.enum(AllowedEncryptionKeyAlgorithms),keyUsage: z.nativeEnum(KmsKeyUsage),isExportable: z.boolean()});@@ -76,14 +76,14 @@ const CmekForm = ({ onComplete, cmek }: FormProps) => {defaultValues: {name: cmek?.name,description: cmek?.description,- encryptionAlgorithm: SymmetricKeyAlgorithm.AES_GCM_256,+ algorithm: SymmetricKeyAlgorithm.AES_GCM_256,keyUsage: KmsKeyUsage.ENCRYPT_DECRYPT,isExportable: cmek?.isExportable ?? true}});const handleCreateCmek = async ({- encryptionAlgorithm,+ algorithm,name,description,keyUsage,@@ -96,9 +96,7 @@ const CmekForm = ({ onComplete, cmek }: FormProps) => {name,description,keyUsage,- encryptionAlgorithm: encryptionAlgorithm as- | AsymmetricKeyAlgorithm- | SymmetricKeyAlgorithm,+ algorithm: algorithm as AsymmetricKeyAlgorithm | SymmetricKeyAlgorithm | HmacAlgorithm,isExportable});@@ -149,7 +147,7 @@ const CmekForm = ({ onComplete, cmek }: FormProps) => {defaultValue={field.value}onValueChange={(e) => {if (keyUsageDefaultOption[e as KmsKeyUsage]) {- setValue("encryptionAlgorithm", keyUsageDefaultOption[e as KmsKeyUsage], {+ setValue("algorithm", keyUsageDefaultOption[e as KmsKeyUsage], {shouldDirty: true,shouldValidate: true});@@ -170,7 +168,7 @@ const CmekForm = ({ onComplete, cmek }: FormProps) => {/><Controllercontrol={control}- name="encryptionAlgorithm"+ name="algorithm"render={({ field: { onChange, ...field }, fieldState: { error } }) => (<FormControlclassName="w-full"diff --git a/frontend/src/pages/kms/OverviewPage/components/CmekSignModal.tsx b/frontend/src/pages/kms/OverviewPage/components/CmekSignModal.tsxindex 69c10b8f0a..f9b86ebdef 100644--- a/frontend/src/pages/kms/OverviewPage/components/CmekSignModal.tsx+++ b/frontend/src/pages/kms/OverviewPage/components/CmekSignModal.tsx@@ -74,9 +74,8 @@ const SignForm = ({ cmek }: FormProps) => {};const allowedSigningAlgorithms = Object.values(SigningAlgorithm).filter((a) => {- if (cmek?.encryptionAlgorithm?.startsWith("ML_DSA"))- return (a as string) === (cmek.encryptionAlgorithm as string);- if (cmek?.encryptionAlgorithm?.startsWith("RSA")) return a.toLowerCase().startsWith("rsa");+ if (cmek?.algorithm?.startsWith("ML_DSA")) return (a as string) === (cmek.algorithm as string);+ if (cmek?.algorithm?.startsWith("RSA")) return a.toLowerCase().startsWith("rsa");return a.toLowerCase().startsWith("ecdsa");});diff --git a/frontend/src/pages/kms/OverviewPage/components/CmekTable.tsx b/frontend/src/pages/kms/OverviewPage/components/CmekTable.tsxindex b27a5689e7..9d1699cabd 100644--- a/frontend/src/pages/kms/OverviewPage/components/CmekTable.tsx+++ b/frontend/src/pages/kms/OverviewPage/components/CmekTable.tsx@@ -482,7 +482,7 @@ export const CmekTable = () => {id,version,description,- encryptionAlgorithm,+ algorithm,isDisabled,isExportable,keyUsage@@ -491,7 +491,7 @@ export const CmekTable = () => {const isSelected = selectedKeyIds.includes(id);const isAsymmetricKey = Object.values(AsymmetricKeyAlgorithm).includes(- encryptionAlgorithm as AsymmetricKeyAlgorithm+ algorithm as AsymmetricKeyAlgorithm);// unexportable asymmetric keys can still surface their public key in the export modalconst cannotExportKey = isAsymmetricKey@@ -592,7 +592,7 @@ export const CmekTable = () => {</Tooltip></div></TableCell>- <TableCell className="uppercase">{encryptionAlgorithm}</TableCell>+ <TableCell className="uppercase">{algorithm}</TableCell><TableCell><Badge variant={variant}>{label}</Badge></TableCell>diff --git a/frontend/src/pages/kms/OverviewPage/components/CmekVerifyMacModal.tsx b/frontend/src/pages/kms/OverviewPage/components/CmekVerifyMacModal.tsxindex 7b27c966da..9bcda7dc46 100644--- a/frontend/src/pages/kms/OverviewPage/components/CmekVerifyMacModal.tsx+++ b/frontend/src/pages/kms/OverviewPage/components/CmekVerifyMacModal.tsx@@ -5,7 +5,6 @@ import { zodResolver } from "@hookform/resolvers/zod";import { z } from "zod";import { createNotification } from "@app/components/notifications";-import { decodeBase64 } from "@app/components/utilities/cryptography/crypto";import {Button,FormControl,@@ -52,7 +51,6 @@ const VerifyMacForm = ({ cmek }: FormProps) => {const {handleSubmit,register,- watch,control,formState: { isSubmitting, errors }} = useForm<FormData>({@@ -79,10 +77,6 @@ const VerifyMacForm = ({ cmek }: FormProps) => {}};- const mac = watch("mac");- const data = watch("data");- const isBase64Encoded = watch("isBase64Encoded");-const macValid = cmekVerifyMac.data?.macValid;const macAlgorithm = cmekVerifyMac.data?.macAlgorithm;@@ -109,18 +103,6 @@ const VerifyMacForm = ({ cmek }: FormProps) => {<span className="text-sm opacity-60">MAC Algorithm:</span><Badge variant="info">{macAlgorithm}</Badge></div>- <div className="mt-3">- <span className="text-sm opacity-60">MAC:</span>{" "}- <div className="rounded-md border border-mineshaft-700 bg-mineshaft-900 p-2 text-sm break-words whitespace-pre-wrap">- {mac}- </div>- </div>- <div>- <span className="text-sm opacity-60">Data:</span>{" "}- <div className="rounded-md border border-mineshaft-700 bg-mineshaft-900 p-2 text-sm">- {isBase64Encoded ? decodeBase64(data).toString() : data}- </div>- </div></div>) : (<>diff --git a/frontend/src/pages/kms/OverviewPage/components/CmekVerifyModal.tsx b/frontend/src/pages/kms/OverviewPage/components/CmekVerifyModal.tsxindex 4edc4a7171..94e407c452 100644--- a/frontend/src/pages/kms/OverviewPage/components/CmekVerifyModal.tsx+++ b/frontend/src/pages/kms/OverviewPage/components/CmekVerifyModal.tsx@@ -92,9 +92,8 @@ const VerifyForm = ({ cmek }: FormProps) => {const signingAlgorithm = cmekVerify.data?.signingAlgorithm;const allowedSigningAlgorithms = Object.values(SigningAlgorithm).filter((a) => {- if (cmek?.encryptionAlgorithm?.startsWith("ML_DSA"))- return (a as string) === (cmek.encryptionAlgorithm as string);- if (cmek?.encryptionAlgorithm?.startsWith("RSA")) return a.toLowerCase().startsWith("rsa");+ if (cmek?.algorithm?.startsWith("ML_DSA")) return (a as string) === (cmek.algorithm as string);+ if (cmek?.algorithm?.startsWith("RSA")) return a.toLowerCase().startsWith("rsa");return a.toLowerCase().startsWith("ecdsa");});