Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodTstCustomCertificateManager.ImportFromPFXFile

function ImportFromPFXFile(const aFilename: string; const aPassword: UnicodeString) : Boolean;
Load a PKCS#12/PFX file: private keys are filed into the "My" store; each certificate is routed by whether we hold its private key (My), whether it is a CA (Root) or otherwise (Trusted). Handles both legacy PKCS#12-KDF and modern PBES2 bags via a dual secret key derived from aPassword. Use to provision an endpoint's identity and trust anchors from a .pfx/.p12 file. Returns True when every private key in the file was stored (or was there already) and something was stored; False when the file does not open under aPassword, or when a private key was not stored - its bag did not decrypt, or no store or key format takes it. The certificates are filed in that case too, routed as for a certificate whose private key is not held.