株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

ルート証明書

$cert =New-SelfSignedCertificate -Type Custom -KeySpec Signature -Subject "CN=VamdemicRootCert" -KeyExportPolicy Exportable -HashAlgorithm sha256 -KeyLength 2048 -CertStoreLocation "Cert:\CurrentUser\My" -KeyUsageProperty Sign -KeyUsage CertSign

作成されたか確認

PS C:\Users\yuta> Get-ChildItem -Path "Cert:\CurrentUser\My\"


   PSParentPath: Microsoft.PowerShell.Security\Certificate::CurrentUser\My

Thumbprint                                Subject
----------                                -------
F59886105D84BAF3B5E24D7AEAE52D65106C791B  CN=f679d479-86ff-49f0-a8b8-2643c1c8fb60
C67BD4D916010561BB6797F020D071E7DA6CCC35  CN=yuta
BFC20F8F0C3DC41691C72A35C75FC4296249EE55  CN=VamdemicRootCert
6114A5004FED7A4651304189964E2A87B0CC94A7  CN=dcd98e0e-3d9a-4148-affd-9d7cc09f0c6c
35D83DB47D1DDF4E71C68FE2CEC56252030ACACB  CN=400ec0b9-3fa4-4a5e-b92a-92fe9a3b97f5

base64形式のテキスト情報に変換する

$certbase64 = [System.Convert]::ToBase64String($cert.RawData)

ファイルとして保存

Set-Content -Value $certbase64 -Path C:\Users\yuta\Desktop\VamdemicRootCA.cer

ルート証明書をインストール




Powershellでインストールする場合

Import-Certificate -FilePath C:\Users\yuta\Desktop\VamdemicRootCA.cer -CertStoreLocation Cert:\LocalMachine\Root\

クライアント証明書作成

New-SelfSignedCertificate -Type Custom -KeySpec Signature -Subject "CN=VamdemicClientCert" -KeyExportPolicy Exportable -HashAlgorithm sha256 -KeyLength 2048 -CertStoreLocation "Cert:\CurrentUser\My" -Signer $cert -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.2")

証明書ストア

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)