Specifies the type of certificate that this cmdlet creates. The acceptable values for this parameter are:
CodeSigningCert
Custom --- 注:需與參數 -TextExtension 搭配使用。
DocumentEncryptionCert
DocumentEncryptionCertLegacyCsp
SSLServerAuthentication (default)
-Subject <String>
Specifies the string that appears in the subject of the new certificate. This cmdlet prefixes CN= to any value that does not contain an equal sign. For multiple subject relative distinguished names (also known as RDNs), separate each subject relative distinguished name with a comma (,). If the value of the relative distinguished name contains commas, separate each subject relative distinguished name with a semicolon (;).
-DnsName <String[]>
This example creates a self-signed SSL server certificate in the computer MY store with the subject alternative name set to www.fabrikam.com, www.contoso.com and Subject and Issuer name set to www.fabrikam.com.
-CertStoreLocation <String>
註:只能設定放在位置My,之後再用工具【管理電腦憑證】手動加入到信任區位置。
Specifies the certificate store in which to store the new certificate. If the current path is Cert:\CurrentUser or Cert:\CurrentUser\My, the default store is Cert:\CurrentUser\My. If the current path is Cert:\LocalMachine or Cert:\LocalMachine\My, the default store is Cert:\LocalMachine\My. Otherwise, you must specify Cert:\CurrentUser\My or Cert:\LocalMachine\My for this parameter. This parameter does not support other certificate stores.
-KeyExportPolicy <KeyExportPolicy[]>
Specifies the policy that governs the export of the private key that is associated with the certificate. The acceptable values for this parameter are:
Exportable
ExportableEncrypted (default)
NonExportable
-KeyUsage <KeyUsage[]>
Specifies the key usages set in the key usage extension of the certificate. The acceptable values for this parameter are:
CertSign
CRLSign
DataEncipherment
DecipherOnly
DigitalSignature
EncipherOnly
KeyAgreement
KeyEncipherment
None (default) --- 等同不限制用途。
NonRepudiation
-NotAfter <DateTime> 與 -NotBefore <DateTime>
指定有效期間。
This example creates a self-signed client authentication certificate in the user MY store. The certificate uses the default provider, which is the Microsoft Software Key Storage Provider. The certificate uses an RSA asymmetric key with a key size of 2048 bits. The subject alternative name is pattifuller@contoso.com.
This command specifies a value for NotAfter. The certificate expires in six months.