pfx

Why would you use a ".pfx" file in .NET

What is the ".pfx" extension used for in .NET? Why does it ask for a password when the solution is being built? ...

Convert .pfx to .cer

Is it possible to convert a .pfx (Personal Information Exchange) file to a .cer (Security Certificate) file? Unless I'm mistaken, isn't a .cer somehow embedded inside a .pfx? I'd like some way to extract it, if possible. ...

How can I create a PFX file from a Java Keystore?

I have a Java keystore (.jks file) holding a single certificate. How can I create a .pfx file from this keystore? ...

Signing in Visual Studio 2005 - error using existing .pfx

Built my project. Created my .pfx using sn.exe -k (to create ShellTradingCCMPROD.pfx). Copied the file to the application folder. In VS 2005, I go to the Signing tab, 'Select From File' and browse to the .pfx file. I hit 'Open' and I get the following error: The file 'C:\2009.02.1.1\ShellTrading.CCM.WinUI\ShellTradingCCMPROD.pfx' cou...

Is it possible to convert an SSL certificate from a .key file to a .pfx?

Hi, is there a way to convert from a .key file to a .pfx file? thank you. EDIT: I only have the .key file but my hosting provider says that I could convert it to .pfx with just that file. ...

Decode a PKCS#12 file

I am looking for ways to decode a PKCS#12 file in .NET, I need to extract the private key and any certificates so that i can programatically access the following. modulus publicExponent privateExponent prime1 prime2 exponent1 exponent2 coefficient I need this informatio so that i can successfully use P...

Extract certificates from PFX file _without_ using OpenSSL

I found an answer that uses OpenSSL, but I'm on Windows, and I don't have it easily to hand. Is there a way (e.g. using CERTUTIL or VBScript) to see the certificates in a .PFX file? If I use "certutil -dump", it asks for the password for the key. I don't particularly care about the key. ...

InvalidOperationException using PFX w/ Windows Forms

I have two exceptions here. Not sure why they occur because I use Form.Invoke to run UI updates on the UI thread. So first, using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Xml; using System.Windows.Forms; namespace Toplr { using Sy...

PFX ConcurrentQueue - is there a way to remove a specific item from the queue

I have an app that has a ConcurrentQueue of items that have an ID property and a ConcurrentQueue of tasks for each item, the queue items look like: class QueueItem { public int ID { get; set; } public ConcurrentQueue<WorkItem> workItemQueue { get; set; } } and the queue itself looks like: ConcurrentQueue<QueueItem> itemQueue; I...

Associate private key to certificate for PFXExportCertStoreEx

I'm trying to export certificate to pfx file. Here's what I do (simplified): h = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, NULL, CERT_STORE_CREATE_NEW_FLAG, NULL); p = CertCreateCertificateContext(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, CertBlob.pbData, CertBlob.cbData); CertSetCertificateContextProperty(p, CERT_KEY_P...

Visual Studio Error: PFX - Error Importing Key / Object already exists

I have a VS 2008 ClickOnce solution that I am attempting to compile with "Sign Manifest" turned on. With this option checked, I am prompted for my PFX's password, and upon entering the correct password I receive the error: "Error Importing Key" / "Object already exists". I'm sure I've hosed something. I've tried to run the "CERTUTIL -...

C# Export cert in pfx format

Hi im trying to use .Net and c# to export a certificate from the cert store into a PFX file. I'm trying to use the X509certificate2.export method wiht the X509ContentType.Pfx flag set, but am unsure how to handle the returned byte array and output it correctly to file. Any help appreciated. Thanks Mark ...

Certificate problem - Error Importing Key "object already exists" after Windows 7 upgrade

I have about 60 .pfx files for all major assemblies for a project. They are unique files, but I use the same password for all. After an upgrade from Windows Vista to Windows 7 I get an Import Key File dialog requesting the password for them when I click Build in Visual Studio 2008. This would have been fine, but after inserting the pas...

"An internal error occurred." when loading pfx file with X509Certificate2

I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath("~/App_Data/myhost.pfx"), "pass"); on a shared web hosting server and I got an error: System.Security.Cryptography.CryptographicException: An internal error occurred. stack trace ends with System.Security.Cryptography.Cryp...

CruiseControl.NET service failing to build due to MSBuild ResolveKeySource error, despite certificate being imported

We just had an XBAP/WBA project added to our build server. It uses a PFX file for signing. I imported the PFX file to the CruiseControl.NET service certificate store, and can see it in the certificate store for the service. Yet we are still seeing an exception thrown by ResoveKeySource: c:\WINDOWS\Microsoft.NET\Framework\v3.5\Micros...

Importing certificate from .pfx file in Windows Server 2008

I need to automate installation of SSL certificates using scripts. I have been able to import server certificate from .pfx file using: certutil -user –p 123 -importpfx "C:\Users\test\Desktop\ISServer.pfx" However, it stores the certificate in Personal folder of Current User. I need to store it in "Trusted People" folder. Is there a wa...

Converting .PFX to .PEM programmatically ?

I need to programmatically extract certificates and their private keys from a MS certificate store, and get them to the .PEM format somehow. I don't want to use OpenSSL at the command line, as I would like to keep everything in memory, avoiding files. I can export them from Windows to a PFX-format blob using PFXExportCertStoreEx(). I ...

winhttpcertcfg giving access to iiS user in Windows 7

I need to give access to the IIS user to a pfx certificate. The website is running under the App Pool under some user AppPoolUser. IIS automatically has the user name "IIS APPPOOL\AppPoolUser" and this is what we need to give access when we use aspnet_regiis -ga . However, when i use winhttpcertcfg to give access to the user "IIS APPPOO...

Change pfx password in .NET

Hi, I wonder how to change the password for .pfx file using crypt32.dll. I tried : public bool ChangePassword(String pfxfilename, String pswd, String newPfxfilename, String newPswd) { IntPtr hMemStore = IntPtr.Zero; IntPtr hCertCntxt = IntPtr.Zero; IntPtr pProvInfo = IntPtr.Zero; bool result = false; ...

Install a pfx certificate in a users store in Windows using WiX

Please, can someone provide me with a WiX snippet or solution for the mentioned scenario. I need to include the pfx file in the WiX msi and the user will download my msi to his machine via the internet explorer and Click install and I need also the certificate to be installed on his machine. ...