Hello,
is it possible to export a certificate in DER Format - if i have only the “intended Purposes” name
… in my case - the “intended Purposes” name is 100% unique - it is “xxx_All_OS”
ThanX for help and nice greetings
erich
PS: my working import looks like this:
MyText.Add( '$certPath = "' + cert_pem + '"' );
MyText.Add( '$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($certPath)' );
MyText.Add( '$cert.Import($certPath)' );
MyText.Add( '$certStore = New-Object System.Security.Cryptography.X509Certificates.X509Store -ArgumentList "Root", "LocalMachine"' );
MyText.Add( 'ArgumentList "Root", "LocalMachine"' );
MyText.Add( '$certStore.Open("ReadWrite")' );
MyText.Add( '$certStore.Add($cert)' );
MyText.Add( '$certStore.Close()' );
my working openssl Config file looks like this:
MyText.Add( '[req]' );
MyText.Add( 'default_bits = 2048 ' );
MyText.Add( 'default_md = sha256 ' );
MyText.Add( 'default_days = 825 ' );
MyText.Add( 'encrypt_key = no ' );
MyText.Add( 'distinguished_name = subject ' );
MyText.Add( 'req_extensions = req_ext ' );
MyText.Add( 'x509_extensions = x509_ext ' );
MyText.Add( 'string_mask = utf8only ' );
MyText.Add( 'prompt = no ' );
MyText.Add( ' ' );
MyText.Add( '[subject] ' );
MyText.Add( 'countryName = AT ' );
MyText.Add( 'stateOrProvinceName = Salzburg ' );
MyText.Add( 'localityName = xxx' );
MyText.Add( 'organizationName = xxx_All_OS' );
MyText.Add( 'OU = xxx_All_OS' );
MyText.Add( 'commonName = xxx_All_OS ' );
MyText.Add( 'emailAddress = xxx_All_OS ' );
MyText.Add( ' ' );
MyText.Add( '[x509_ext]' );
MyText.Add( 'subjectKeyIdentifier = hash ' );
MyText.Add( 'authorityKeyIdentifier = keyid:always,issuer' );
MyText.Add( 'basicConstraints = critical, CA:TRUE' );
MyText.Add( 'keyUsage = critical, digitalSignature, keyEncipherment, cRLSign, keyCertSign' );
MyText.Add( 'subjectAltName = @alt_names ' );
MyText.Add( 'extendedKeyUsage = serverAuth' );
MyText.Add( 'extendedKeyUsage = TLS Web Server Authentication ' );
MyText.Add( ' ' );
MyText.Add( '[req_ext] ' );
MyText.Add( 'subjectKeyIdentifier = hash ' );
MyText.Add( 'basicConstraints = CA:FALSE ' );
MyText.Add( 'keyUsage = digitalSignature, keyEncipherment ' );
MyText.Add( 'subjectAltName = @alt_names ' );
MyText.Add( 'nsComment = "xxx_All_OS" ' );
MyText.Add( ' ' );
MyText.Add( '[alt_names]' );
MyText.Add( 'IP.1 = ' + edIPAdress.Text );
MyText.SaveToFile( Dossier + '\san.cnf' );