设为首页 收藏本站
查看: 549|回复: 0

[经验分享] Unable to Export certificates as Personal Information Exchange

[复制链接]

尚未签到

发表于 2015-9-11 08:57:37 | 显示全部楼层 |阅读模式
http://www.networksteve.com/forum/topic.php/Unable_to_Export_certificates_as_Personal_Information_Exchange_-/?TopicId=5343&Posts=6

We are using Windows 2003 Certificate Authorities, and we are unable to Export certificates as .PFX, our only options are, DER encoded binary X.509 (.CER), Base-64 encoded X.509 (.CER), or Cryptographic Message Syntax Standard - PKCS #7 Certificates (.P7B).  The .PFX option is grayed out in the Certificate Export Wizard on the CA.   This posses a problem because our Windows 2008 server running IIS 7 wants us to import a certificate as .PFX  can someone explain what is happening and how to fix it please
February 18th, 2010 11:27pm

Too late to fix the existing.Your certificate template must allow export of private key (enable the option on the Request Handling tab - if I remember correctly). The ability to export the private key is determined at the time of key generation (prior to creation of the actual certificate).Can you tell me more about your scenario? In many cases, IIS can have different certificates in a LBS cluster, as long as the subject information is identical on each node. That being said, there are some apps that do require the same certificate. In those cases, you need to move towards custom requests (not domain requests) that request a custom certificate template that enables key exportBrian
February 19th, 2010 12:09am

Thank you Brian for the quick reply.  I do have a check box in the "Allow private key to be exported" section on the Request Handling tab, that's why this is driving me crazy.    Well all this was prompted by an error when trying to use IIS on a Windows Server 2008 to request a Domain Certificate from a Windows 2003 CA.   Create Certificate  The certificate request was submitted to the online authority, but was not issued, The request was denied.   I have permissions on the template set to:  Authenticated Users - Read, Write, Enroll  The2008Server$ - Read, Write, Enroll  Domain Admins - Read, Write, Enroll  Domain Computers - Read, Write, Enroll   I am able to run the Certificate MMC and request it that way and it works.
February 19th, 2010 12:39am

You cannot do a Domain request as it is hard coded to request the Web Server certificate template, not your custom template that you have created that enables key export.- you can verify this by doing a dump of the binary request that failed. CHeck out the actual certificate template requestedBrian
February 19th, 2010 12:51am

dope, thank you very much Brian that explanation helps a lot, I wish the error message said that instead of "check your permissions you idiot" you don't know how much hair I lost trying to troubleshoot this
February 19th, 2010 4:21pm

OK, I don't mean to beat a dead horse to death, but...  On my Windows Server 2003 Enterprise Edition SP2 Certificate Authority server I launch the Certificate Authority MMC, I click on Issued Certificates, then I find and click on the Web Server certificate I issued to a Windows 2008 Server Standard Edition SP2 based on a duplicated template version 100.7 with the export private key enabled feature on, then I click on the Details tab and Copy to File button, that launches the Certificate Export Wizard I click on Next and the Personal Information Exchange - PKC #12 (.PFX) is grayed out  ... but ...  when I go to the Windows 2008 Server Standard Edition SP2 that got the certificate and launch the Certificate MMC and go to Certificates (Local Computer) \ Personal \ Certificates and doble click on the issued certificate then go to the Details tab click on Copy to File button and  launch the Certificate Export Wizard, click Next, say Yes, export the private key, click Next, then the Personal Information Exchange - PKC #12 (.PFX) is available.  THAT MAKES ABSOLUTELY NO SENSE TO ME  I reissued the cert a few times and same result every time.
February 19th, 2010 11:15pm

This means that Microsoft listened when people stated that they wanted to be able to export Web server certificates.In the *newer* build, you are able to do that.In the *older* build you cannotRemember what I said earlier, the decision whether the private key is exportable is made **before** the request is event sent to the CA. You can override this option in the certificate template. So Windows SErver 2008 does. Windows Server 2003 does not.Brian
February 20th, 2010 1:11am

Greg --
The private key doesn't exist on the CA, but it does exist on the computer on whic you created the request. Here's what happens when you request a certificate.
If you're generating a request with a new key pair -- which you will in the vast majority of cases -- Windows first generates the public and private key pair. The private key is written to a key store. Where the key store is located will depend on which
Cryptographic Service Provider (CSP) or Key Storage Provider (KSP) is specified in the template. KSPs were introduced in Windows Server 2008/Vista, and are only available in v3 templates. In the case of most of the default Microsoft CSP/KSPs (with the exception
of those used with Smart Cards), the key store is located in either the user's profile, or in the case of computer certificates, the All Users profile. It is at this point, by the way, that the properties of that private key are also written to the key store.
One property of interest to you immediately is whether or not Windows should allow the private key to be exported.
Once the key pair is generated, the request is then created. The request contains the information that should be in the certificate. This information is generally specified by the template with the exception of the Subject field, which contains the Common
Name or Distinguished name of whoever is requesting the certificate. In the case of IIS, the Subject will be your site name. The public key is included in the request. Windows then signs the request with the newly created private key.
Windows also creates a dummy certificate object in the Certificate Enrollment Requests store so that it knows that there is an outstanding request.
At this point, the request is saved to a file or sent to an online CA depending on how you generated the request. Note that the private key is
not sent to the CA in most cases. The exception to this rule occurs when you have Key Archival enabled on the CA, and the template specifies that the private key should be archived in the CA database. If this is the case, Windows retrieves
the CA Exchange certificate from the CA and uses the public key in that certificate to encrypt the newly created private key. This encrypted private key is included in the request.
Once the CA receives the request, it processes that request to determine if it should issue the certificate or not. In the case of the Enterprise CA, this decision is based on the permissions on the template. One can also specify that certain templates
require CA manager approval before they can be issued. Assuming that everything is correct in the request, and that the necessary information can be retrieved from Active Directory (perhaps the user's email address, or the computer's DNS host name -- it depends
on the settings in the template), and that any CA Manager approvals specified in the template have been performed, the CA builds the certificate and signs it with its current private key. The certificate has been created.
This certificate is stored in the CA database, which is why you can export it in the Certificate Authority snap-in. If the encrypted private key for that certificate has been included in the request to be archived, the CA decrypts it first with its CA Exchange
private key, and then re-encrypts it using the public key(s) for any Key Recovery Agents configured on the CA. The newly encrypted private key is also stored in the CA database. Note that this encrypted private key can only be retrieved and decrypted
by a valid KRA. The CA then returns the certificate to principal who requested it. If the request was first saved as a file and then submitted to the CA you have to retrieve the certificate manually. It is only returned automatically if you submitted the request via the
Certificiates MMC, or if the application you use to submit the request retrieves it for you. IIS does this, when you use the certificate request wizard to request a Web Server certificate.
When the client has received the certificate, it locates the dummy certificate object in the Certificate Enrollment Requests store. From this object, Windows copies the location of the key store for the private key (among other things). This dummy certificate
object is then deleted, and the new certificate is imported into the Personal store. The private key information is then written to an internal property of the certificate in the store. This is how Windows locates the private key of that certificate in order
to use it when you invoke the associated certificate.
When you go to export the certificate and private key, Windows reads the private key locate information from the certificate properties in order to find the key store wherein it is located. Assuming export is allowed, the certificate and private key are written
to a password protected PFX file.
That's how a certificate request gets turned into a certificate, and explains why the private key doesn't exist on the CA. If you need to generate a PFX file, then you'll have to export the certificate from the computer on which you generated the request.
Hope this helps.
Jonathan StephensJonathan Stephens
April 19th, 2010 1:23am

Jonathan,


that was really helpful, But i am still having issues with the export.

i am pretty much on the same situation, and no matter what, i can't export the private key. i have setup the template to archive the key, export the key, but still, it's not letting me export the key. I also tried to export from the machine where i installed
the certificate but no luck.

I am trying to deploy the wireless security using computer certificate, and i don't thing it will work without the private key installed on the machine.


thanks,
julu007
January 8th, 2011 4:26pm


Click on the issued certificate and copy to a file.

Double click the newly created file and select "Install Certificate"

The Import Wizard opens, select Next.

Select "Automatically select the certificate store...", click Next

Click Finish



Now go to MMC and add snapin.

Click Certificates and select Certificates - My user account, click Finish



Now go into Certificates- Current User

Personal

Certificates

Right Click the certificate you just imported and select export

Select next

You can now export the .pfx file with password.

March 24th, 2011 12:19pm
  This topic is archived. No further replies will be accepted.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-112138-1-1.html 上篇帖子: CDOJ 482 Charitable Exchange bfs 下篇帖子: exchange webservice访问类(日程新增和删除)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表