Commit 1c79f00
committed
refactor: Switch certutil to primary export method with PowerShell fallback
- certutil.exe proved to be more reliable than PowerShell's Export-PfxCertificate
- certutil is the underlying tool used by Windows Certificate Manager (MMC)
- Switched method priority: certutil first, PowerShell as fallback
- Both methods support password-protected PFX export
- Reduces warnings in output when certutil succeeds (no unnecessary fallback attempts)
- Maintains backward compatibility by keeping PowerShell fallback
Rationale:
- PowerShell Export-PfxCertificate has undocumented limitations with certain passwords
- certutil handles edge cases and special characters in passwords more robustly
- Users familiar with MMC will recognize certutil as the trusted method
- No behavioral change for end users - exports still work the same way
Testing verified:
- Direct certutil export succeeds without fallback
- PFX file created with correct naming and size
- Password protection preserved correctly1 parent 9d186a8 commit 1c79f00
1 file changed
Lines changed: 40 additions & 51 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
336 | 352 | | |
337 | 353 | | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
| 354 | + | |
350 | 355 | | |
351 | 356 | | |
352 | 357 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
379 | 364 | | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
389 | 378 | | |
390 | 379 | | |
391 | | - | |
| 380 | + | |
392 | 381 | | |
393 | 382 | | |
394 | 383 | | |
395 | 384 | | |
396 | | - | |
| 385 | + | |
397 | 386 | | |
398 | 387 | | |
399 | 388 | | |
| |||
0 commit comments