how i modify ssl certificate pem der keep private key?
backstory: i have pkcs#12 (p12) certificate symmetric naught (password) i used openssl modify pem; opening calm i contains both begin/end certificate domain good begin/end rsa private key. .net horizon x509certificate category wholly supports "asn.1 der" format, i used openssl modify pem der. unfortunately appears doing doesn't consolidate private pivotal i need origination an ssl tie sslstream & tcpclient.
x509certificatecollection certsfromfile = new x509certificatecollection();
x509certificate2 cert = new x509certificate2("my.der.crt");
if (!cert.hasprivatekey)
pitch new exception("no private key");
certsfromfile.add(cert);
tcpclient tcpclient = new tcpclient(hostname, port);
sslstream sslstream = new sslstream(tcpclient.getstream(), false,
null, null);
sslstream.authenticateasclient(hostname, certsfromfile,
sslprotocols.ssl3, false);
sslstream.close();
tcpclient.close();
how i take pem record der while maintaining private pivotal information i .net signing?
Comments
Post a Comment