LoginSignup
2
1

1.はじめに

 Windows 10 でオレオレ証明書を作ろうとしたら意外な点で躓きましたので、今後の備忘録がわりに記録します。

2.MakeCert.exe が動作しなくなった?!

 以前はmakecert.exe を使ってオレオレ証明書を作っていました。そのときの手順はこのページに示されています。

しかし、2023年10月7日現在にて、Windows 10 では makecert.exe は動作しません。
makecert.exe.png

3.令和5年現在の証明書の作成方法

makecert.exeは現在非推奨となっており、代わりにPowershellのNew-SelfSignedCertificateコマンドレットを使用することが推奨されています。

以下に、自己署名証明書を作成する新しい方法を示します。ここでは AzureManagementAPI用の証明書を例としています。

3.1.以下のコマンドをPowerShellで実行します:

$cert = New-SelfSignedCertificate -DnsName AzureManagementAPI -CertStoreLocation "cert:\\LocalMachine\\My" -NotAfter (Get-Date).AddYears(1)

3.2.パスワードを作成します。

$password = ConvertTo-SecureString -String "パスワード" -Force -AsPlainText

3.3.証明書をエクスポートします。pfx形式でエクスポートする場合は以下のコマンドを実行します

Export-PfxCertificate -Cert $cert -FilePath "C:\\azuremanagementapi.pfx" -Password $password

3.4.cer形式でエクスポートする場合は以下のコマンドを実行します:

Export-Certificate -Type CERT -Cert $cert -FilePath C:\\azuremanagementapi.cer

上記で作成した証明書(cerファイル)をAzureのポータルへアップロードすることで、AzureManagementAPIを利用することができるようになります。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1