Create Sub certificate from existing pfx

0

I have a certificate Root/CA1. With PowerShell want to get / import the CA1 and from this I want to create a Sub CA2 certificate.

To read the certificate I tried

$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import($CertFile,"password",'DefaultKeySet')`

and also

Get-PfxCertificate -FilePath "file.pfx"

Then I use New-SelfSignedCertificate... - Signer $cert. But I always get the following error:

New-SelfSignedCertificate : CertEnroll::CSignerCertificate::Initialize: Cannot find object or property. 0x80092004 (-2146885628 CRYPT_E_NOT_FOUND)

How can I Import / get the existing certificate? With the target to use it as signer for a Sub certificate.

powershell
certificate
asked on Stack Overflow Mar 29, 2019 by Mario • edited Mar 29, 2019 by Seth

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0