Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# 証明書ストアのパス確認
PS C:\Users\Administrator> Get-PSDrive | Format-Table -AutoSize -Wrap
Name Used (GB) Free (GB) Provider Root CurrentLocation
---- --------- --------- -------- ---- ---------------
Alias Alias
C 14.36 104.91 FileSystem C:\ Users\Administrator
Cert Certificate \
D FileSystem D:\
Env Environment
Function Function
HKCU Registry HKEY_CURRENT_USER
HKLM Registry HKEY_LOCAL_MACHINE
Variable Variable
WSMan WSMan
# 自己署名証明書を作成
# -DnsName (DNS名)
# -KeyAlgorithm (RSA | ECDSA_nistP256 | ECDSA_nistP384 | ECDSA_nistP521)
# -KeyLength (RSA の鍵長)
# -CertStoreLocation (証明書ストア)
# -NotAfter (有効期間 : 下例は 10年)
PS C:\Users\Administrator> New-SelfSignedCertificate `
-DnsName "rx-7.srv.world" `
-KeyAlgorithm "ECDSA_nistP384" `
-CertStoreLocation "Cert:\LocalMachine\My" `
-NotAfter (Get-Date).AddYears(10)
PSParentPath: Microsoft.PowerShell.Security\Certificate::LocalMachine\My
Thumbprint Subject
---------- -------
D3C8A1AA62DC52BF21C910EC98BBDD370298FDF4 CN=rx-7.srv.world
|