WEB server 用に証明書を発行する。(windwos)

オレオレ詐欺
IISを使用すると国とかいらんもん入れさせられるのでIISは使いません><

certreq.exeを利用

;----------------- request.inf -----------------
[Version]
Signature="$Windows NT$

[NewRequest]
Subject = "CN=" ; replace with the FQDN of the DC
PrivateKeyArchive=false
KeySpec = 1
KeyUsage = 0xa0
Providertype = 12
RequestType = pkcs10
ProviderName = "Microsoft RSA SChannel Cryptographic Provider"
KeyLength = 2048
SMIME = TRUE
MachineKeySet = true
Exportable = TRUE

[EnhancedKeyUsageExtension]
OID=1.3.6.1.5.5.7.3.1 ; this is for Server Authentication

[RequestAttributes]
CertificateTemplate = WebServer
;-----------------------------------------------

CertificateTemplateがテンプレートの指定。
これがないとエラーになる

証明書は発行されていません (拒否) ポリシー モジュールによって拒否されました 0x80094801, 要求は証明書テンプレートの拡張機能または CertificateTemplate 要求属性を含んでいません。
この要求には証明書のテンプレート情報が含まれていません。 0x80094801 (-2146875391)
証明書要求のプロセッサ: この要求には証明書のテンプレート情報が含まれていません。 0x80094801 (-2146875391)
ポリシー モジュールによって拒否されました 0x80094801, 要求は証明書テンプレートの拡張機能または CertificateTemplate 要求属性を含んでいません。

リクエストの作成

certreq -new request.inf request.req

発行

certreq -submit request.req request.cer

pfx(pkcs#12)はつくれないっぽい。
結局OpenSSLで

参考
http://support.microsoft.com/kb/931351/ja
http://technet.microsoft.com/en-us/library/cc736326(WS.10).aspx
http://technet.microsoft.com/en-us/library/cc737264(WS.10).aspx

certutil -csplist