fix: add password parameter to pemToPfx and importCertificate functions for enhanced security

This commit is contained in:
2026-05-22 14:36:43 +02:00
parent 17fecaca22
commit 2f6db155cb
3 changed files with 14 additions and 9 deletions
+2 -1
View File
@@ -47,8 +47,9 @@ export class KeyVaultStore {
return expiresOn.getTime() - Date.now() <= thresholdMs;
}
async importCertificate(name: string, cert: string | Buffer, format: 'pem' | 'pfx' = 'pem'): Promise<void> {
async importCertificate(name: string, cert: string | Buffer, format: 'pem' | 'pfx' = 'pem', password?: string): Promise<void> {
const options: ImportCertificateOptions = {
password,
policy: {
contentType: format === 'pfx' ? 'application/x-pkcs12' : 'application/x-pem-file',
issuerName: 'Unknown',