Skip to content

Commit 0459736

Browse files
committed
Added backticks around references to the MY certificate stores and various provider values that can be passed to the Provider parameter. Took a crack at formatting help for the TextExtension parameter.
1 parent 978bbf1 commit 0459736

File tree

1 file changed

+106
-148
lines changed

1 file changed

+106
-148
lines changed

docset/winserver2022-ps/pki/New-SelfSignedCertificate.md

Lines changed: 106 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ title: New-SelfSignedCertificate
1111
# New-SelfSignedCertificate
1212

1313
## SYNOPSIS
14-
1514
Creates a new self-signed certificate for testing purposes.
1615

1716
## SYNTAX
@@ -55,7 +54,7 @@ $params = @{
5554
New-SelfSignedCertificate @params
5655
```
5756

58-
This example creates a self-signed SSL server certificate in the computer MY store with the subject
57+
This example creates a self-signed SSL server certificate in the computer `MY` store with the subject
5958
alternative names `www.fabrikam.com` and `www.contoso.com` and the Subject and Issuer name set to
6059
`www.fabrikam.com`.
6160

@@ -68,7 +67,7 @@ PS Cert:\LocalMachine\My> New-SelfSignedCertificate -CloneCert $OldCert
6867
```
6968

7069
This example creates a copy of the certificate specified by the **CloneCert** parameter and puts it
71-
in the computer MY store.
70+
in the computer `MY` store.
7271

7372
### EXAMPLE 3
7473

@@ -87,9 +86,9 @@ $params = @{
8786
New-SelfSignedCertificate @params
8887
```
8988

90-
This example creates a self-signed S/MIME certificate in the user MY store. The certificate uses the
91-
default provider, which is the `Microsoft Software Key Storage Provider`. The certificate uses an
92-
`RSA` asymmetric key with a key size of `2048` bits. This certificate has the subject alternative
89+
This example creates a self-signed S/MIME certificate in the user `MY` store. The certificate uses
90+
the default provider, which is the `Microsoft Software Key Storage Provider`. The certificate uses
91+
an `RSA` asymmetric key with a key size of `2048` bits. This certificate has the subject alternative
9392
names of `[email protected]` as RFC822 and `[email protected]` as Principal Name.
9493

9594
This command does not specify the **NotAfter** parameter. Therefore, the certificate expires in one
@@ -112,7 +111,7 @@ $params = @{
112111
New-SelfSignedCertificate @params
113112
```
114113

115-
This example creates a self-signed client authentication certificate in the user MY store. The
114+
This example creates a self-signed client authentication certificate in the user `MY` store. The
116115
certificate uses the default provider, which is the `Microsoft Software Key Storage Provider`. The
117116
certificate uses an `RSA` asymmetric key with a key size of `2048` bits. The certificate has a
118117
subject alternative name of `[email protected]`.
@@ -136,10 +135,10 @@ $params = @{
136135
New-SelfSignedCertificate @params
137136
```
138137

139-
This example creates a self-signed client authentication certificate in the user MY store. The
138+
This example creates a self-signed client authentication certificate in the user `MY` store. The
140139
certificate uses the default provider, which is the `Microsoft Software Key Storage Provider`. The
141-
certificate uses an elliptic curve asymmetric key and the curve parameters nist256, which creates a
142-
256-bit key. The subject alternative name is `[email protected]`.
140+
certificate uses an elliptic curve asymmetric key and the curve parameters `nist256`, which creates
141+
a 256-bit key. The subject alternative name is `[email protected]`.
143142

144143
The certificate expires in one year.
145144

@@ -162,7 +161,7 @@ $params = @{
162161
New-SelfSignedCertificate @params
163162
```
164163

165-
This example creates a self-signed client authentication certificate in the user MY store. The
164+
This example creates a self-signed client authentication certificate in the user `MY` store. The
166165
certificate uses the `Microsoft Platform Crypto Provider`. This provider uses the Trusted Platform
167166
Module (TPM) of the device to create the asymmetric key. The certificate uses an `RSA` asymmetric
168167
key with a key size of `2048` bits. The key is not exportable. The subject alternative name is
@@ -210,9 +209,9 @@ $params = @{
210209
New-SelfSignedCertificate @params
211210
```
212211

213-
This example creates a self-signed S/MIME certificate in the user MY store. The certificate uses the
214-
default provider, which is the `Microsoft Software Key Storage Provider`. The certificate uses an
215-
`RSA` asymmetric key with a key size of `2048` bits. This certificate has the subject alternative
212+
This example creates a self-signed S/MIME certificate in the user `MY` store. The certificate uses
213+
the default provider, which is the `Microsoft Software Key Storage Provider`. The certificate uses
214+
an `RSA` asymmetric key with a key size of `2048` bits. This certificate has the subject alternative
216215
names of `[email protected]` and `[email protected]` both as RFC822.
217216

218217
This command does not specify the **NotAfter** parameter. Therefore, the certificate expires in one
@@ -229,7 +228,7 @@ New-SelfSignedCertificate @params
229228
```
230229

231230
This example creates a self-signed SSL server certificate with Subject and Issuer name set to
232-
`localhost` and with subject alternative name set to IPAddress `127.0.0.1` and `::1` via
231+
`localhost` and with subject alternative name set to **IPAddress** `127.0.0.1` and `::1` via
233232
**TextExtension**.
234233

235234
## PARAMETERS
@@ -435,7 +434,7 @@ Accept wildcard characters: False
435434
### -HardwareKeyUsage
436435

437436
Specifies how a hardware key associated with the new certificate may be used. This parameter applies
438-
only when you specify the Microsoft Platform Crypto Provider. The acceptable values for this
437+
only when you specify the `Microsoft Platform Crypto Provider`. The acceptable values for this
439438
parameter are:
440439

441440
- `None`
@@ -486,9 +485,9 @@ Algorithms (ECDSA).
486485

487486
The elliptic curve algorithm syntax is the following:
488487

489-
`ECDSA_`curvename
488+
`ECDSA_{curvename}`
490489

491-
To obtain a value for curvename, use the `certutil -displayEccCurve` command.
490+
To obtain a value for `{curvename}`, use the `certutil -displayEccCurve` command.
492491

493492
Valid curve names contain a value in the **Curve OID** column in the output of the
494493
`certutil -displayEccCurve` command.
@@ -527,8 +526,9 @@ Specifies the policy that governs the export of the private key that is associat
527526
certificate.
528527

529528
The default value of `ExportableEncrypted` is not compatible with KSP and CSPs that do not allow key
530-
export. These include the Microsoft Smart Card Key Storage Provider and the Microsoft Platform
531-
Crypto Key Storage Provider. Specify `NonExportable` for providers that do not allow key export.
529+
export. These include the `Microsoft Smart Card Key Storage Provider` and the
530+
`Microsoft Platform Crypto Key Storage Provider`. Specify `NonExportable` for providers that do not
531+
allow key export.
532532

533533
```yaml
534534
Type: Microsoft.CertificateServices.Commands.KeyExportPolicy[]
@@ -578,7 +578,7 @@ Accept wildcard characters: False
578578
### -KeyLocation
579579

580580
Specifies the file system location where this cmdlet stores the private keys associated with the new
581-
certificate. Specify this parameter only when you specify the Microsoft Platform Crypto Provider.
581+
certificate. Specify this parameter only when you specify the `Microsoft Platform Crypto Provider`.
582582

583583
```yaml
584584
Type: System.String
@@ -710,8 +710,8 @@ Accept wildcard characters: False
710710
### -NotAfter
711711

712712
Specifies the date and time, as a **DateTime** object, that the certificate expires. To obtain a
713-
**DateTime** object, use the Get-Date cmdlet. The default value for this parameter is one year after
714-
the certificate was created.
713+
**DateTime** object, use the `Get-Date` cmdlet. The default value for this parameter is one year
714+
after the certificate was created.
715715

716716
```yaml
717717
Type: System.DateTime
@@ -969,146 +969,104 @@ Accept wildcard characters: False
969969
Specifies an array of certificate extensions, as strings, which this cmdlet includes in the new
970970
certificate. Each string must employ one of the following formats:
971971

972-
oid`=`base64String, where oid is the object identifier of the extension and base64String is a value
973-
that you provide. After decoding base64String, the value must be valid Abstract Syntax Notation One
974-
(ASN.1). For more information, see
972+
`{oid}={base64String}`, where `{oid}` is the object identifier of the extension and `{base64String}`
973+
is a value that you provide. After decoding `{base64String}`, the value must be valid Abstract
974+
Syntax Notation One (ASN.1). For more information, see
975975
[Abstract Syntax Notation One (ASN.1): Specification of basic notation](http://www.itu.int/ITU-T/studygroups/com17/languages/X.680-0207.pdf).
976976

977-
oid`={hex}`hexidecimalString, where oid is the object identifier of the extension and
978-
hexidecimalString is a value that you provide. After decoding hexidecimalString, the value must be
979-
valid ASN.1.
977+
`{oid}={hex}{hexadecimalString}`, where `{oid}` is the object identifier of the extension and
978+
`{hexadecimalString}` is a value that you provide. After decoding `{hexadecimalString}`, the value
979+
must be valid ASN.1.
980980

981-
oid`={text}`String, where oid is the object identifier of the extension and String is a value that
982-
you provide. String must contain a textual representation of the extension value in a format
983-
specific to each object ID. When String is processed, it will be encoded into an ASN.1 extension
984-
value before being placed into the new certificate as an extension.
981+
`{oid}={text}{String}`, where `{oid}` is the object identifier of the extension and `{String}` is a
982+
value that you provide. `{String}` must contain a textual representation of the extension value in a
983+
format specific to each object ID. When `{String}` is processed, it will be encoded into an ASN.1
984+
extension value before being placed into the new certificate as an extension.
985985

986-
To specify that an extension is critical, insert `{critical}` immediately following `oid=` in any of
987-
the previous cases.
986+
To specify that an extension is critical, insert `{critical}` immediately following `{oid}=` in any
987+
of the previous cases.
988988

989989
The object identifiers of some common extensions are as follows:
990990

991-
- Application Policy.
992-
`1.3.6.1.4.1.311.21.10`
993-
- Application Policy Mappings.
994-
`1.3.6.1.4.1.311.21.11`
995-
- Basic Constraints.
996-
`2.5.29.19`
997-
- Certificate Policies.
998-
`2.5.29.32`
999-
- Enhanced Key Usage.
1000-
`2.5.29.37`
1001-
- Name Constraints.
1002-
`2.5.29.30`
1003-
- Policy Mappings.
1004-
`2.5.29.33`
1005-
- Subject Alternative Name.
1006-
`2.5.29.17`
1007-
1008-
Application Policy
1009-
`1.3.6.1.4.1.311.21.10={text}token=value&token=value…`
1010-
The tokens have the following possible values:
1011-
1012-
- Flags.
1013-
0xhexidecimalNumber
1014-
- GUID.
1015-
A globally unique ID, such as this example: `f7c3ac41-b8ce-4fb4-aa58-3d1dc0e36b39`
1016-
- Notice.
1017-
Text notice
1018-
- OID.
1019-
Object identifier in dotted decimal notation, such as this example: `1.2.3.4.5`
1020-
- URL.
1021-
The URL of a host, such as this example: `http://computer07.contoso.com`
991+
- Application Policy: `1.3.6.1.4.1.311.21.10`
992+
- Application Policy Mappings: `1.3.6.1.4.1.311.21.11`
993+
- Basic Constraints: `2.5.29.19`
994+
- Certificate Policies: `2.5.29.32`
995+
- Enhanced Key Usage: `2.5.29.37`
996+
- Name Constraints: `2.5.29.30`
997+
- Policy Mappings: `2.5.29.33`
998+
- Subject Alternative Name: `2.5.29.17`
999+
1000+
Application Policy extension example: `1.3.6.1.4.1.311.21.10={text}{token}={value}&{token}={value}...`
1001+
1002+
You can specify the following tokens in an Application Policy extension:
1003+
1004+
- **Flags**: Bitwise flags in hexadecimal notation: `0x{hexadecimalNumber}`
1005+
- **GUID**: A globally unique ID, such as this example: `f7c3ac41-b8ce-4fb4-aa58-3d1dc0e36b39`
1006+
- **Notice**: Text notice
1007+
- **OID**: Object identifier in dotted decimal notation, such as this example: `1.2.3.4.5`
1008+
- **URL**: The URL of a host, such as this example: `http://computer07.contoso.com`
10221009

10231010
To specify an Application Policy extension, specify the first object identifier, followed by zero or
1024-
more other **token=value** entries. These entries are subordinate to the preceding object
1025-
identifier. Specify subsequent object identifiers, each followed by its subordinate **token=value**
1026-
entries.
1027-
1028-
Application Policy Mappings
1029-
`1.3.6.1.4.1.311.21.11={text}oid=oid&oid=oid…`
1030-
1031-
Certificate Policies
1032-
`2.5.29.32={text}token=value&token=value…`
1033-
The tokens have the following possible values:
1034-
1035-
- Flags.
1036-
0xhexidecimalNumber
1037-
- GUID.
1038-
A globally unique ID, such as this example: `f7c3ac41-b8ce-4fb4-aa58-3d1dc0e36b39`
1039-
- Notice.
1040-
Text notice
1041-
- OID.
1042-
Object ID in dotted decimal notation, such as this example: `1.2.3.4.5`
1043-
- URL.
1044-
The URL of a host, such as this example: `http://computer07.contoso.com`
1011+
more other `{token}={value}` entries. These entries are subordinate to the preceding object
1012+
identifier. Specify subsequent object identifiers, each followed by its subordinate
1013+
`{token}={value}` entries.
1014+
1015+
Application Policy Mappings extension example: `1.3.6.1.4.1.311.21.11={text}oid={oid}&oid={oid}...`
1016+
1017+
Certificate Policies extension example: `2.5.29.32={text}{token}={value}&{token}={value}...`
1018+
1019+
You can specify the following tokens in a Certificate Policies extension:
1020+
1021+
- **Flags**: Bitwise flags in hexadecimal notation: `0x{hexadecimalNumber}`
1022+
- **GUID**: A globally unique ID, such as this example: `f7c3ac41-b8ce-4fb4-aa58-3d1dc0e36b39`
1023+
- **Notice**: Text notice
1024+
- **OID**: Object identifier in dotted decimal notation, such as this example: `1.2.3.4.5`
1025+
- **URL**: The URL of a host, such as this example: `http://computer07.contoso.com`
10451026

10461027
To specify a Certificate Policies extension, follow the same syntax as an Application Policy
10471028
extension.
10481029

1049-
Enhanced Key Usage Object Identifiers
1050-
`2.5.29.37={text}oid,oid…`
1030+
Enhanced Key Usage Object Identifiers extension example: `2.5.29.37={text}{oid},{oid}...`
1031+
10511032
These key usages have the following object identifiers:
10521033

1053-
- Client Authentication.
1054-
`1.3.6.1.5.5.7.3.2`
1055-
- Server Authentication.
1056-
`1.3.6.1.5.5.7.3.1`
1057-
- Secure Email.
1058-
`1.3.6.1.5.5.7.3.4`
1059-
- Code Signing.
1060-
`1.3.6.1.5.5.7.3.3`
1061-
- Timestamp Signing.
1062-
`1.3.6.1.5.5.7.3.8`
1063-
1064-
Name Constraints `2.5.29.30={text}subtree=subtreeValue&token=value&token=value&`
1065-
`…&subtree=subtreeValue&token=value&token=value…` The subtreeValue can have the following values:
1066-
1067-
- `Include`.
1068-
Permitted names
1069-
- `Exclude`.
1070-
Excluded names
1071-
1072-
The tokens have the following possible values:
1073-
1074-
- DirectoryName.
1075-
`CN=Name,DC=Domain,DC=com`
1076-
- DNS.
1077-
A computer name in the following format: `computer.contoso.com`
1078-
- Email.
1079-
An email address, such as this example: `[email protected]`
1080-
- IPAddress.
1081-
IPV4 address,IPV4 subnet mask or IPV6 address,IPV6 subnet mask
1082-
- RegisteredID.
1083-
ID in dotted decimal notation, such as this example: `1.2.3.4.5`
1084-
- UPN.
1085-
A user principal name in the following format: `[email protected]`
1086-
- URL.
1087-
The URL of a host, such as this example: `http://computer07.contoso.com/index.html`
1088-
1089-
Policy Mapping
1090-
`2.5.29.33={text}oid=oid&oid=oid…`
1091-
1092-
Subject Alternative Name Syntax
1093-
`2.5.29.17={text}token=value&token=value…`
1094-
The tokens have the following possible values:
1095-
1096-
- UPN.
1097-
A user principal name in the following format: `[email protected]`
1098-
- Email.
1099-
An email address, such as this example: `[email protected]`
1100-
- DNS.
1101-
A computer name in the following format: `computer.contoso.com`
1102-
- DirectoryName.
1103-
`CN=Name,DC=Domain,DC=com`
1104-
- URL.
1105-
The URL of a host, such as this example: `http://computer07.contoso.com/index.html`
1106-
- IPAddress.
1107-
An IP address
1108-
- RegisteredID.
1109-
ID in dotted decimal notation, such as this example: `1.2.3.4.5`
1110-
- GUID.
1111-
A globally unique ID, such as this example: `f7c3ac41-b8ce-4fb4-aa58-3d1dc0e36b39`
1034+
- Client Authentication: `1.3.6.1.5.5.7.3.2`
1035+
- Server Authentication: `1.3.6.1.5.5.7.3.1`
1036+
- Secure Email: `1.3.6.1.5.5.7.3.4`
1037+
- Code Signing: `1.3.6.1.5.5.7.3.3`
1038+
- Timestamp Signing: `1.3.6.1.5.5.7.3.8`
1039+
1040+
Name Constraints extension example:
1041+
`2.5.29.30={text}subtree=include&{token}={value}&{token}={value}&subtree=exclude&{token}={value}...`
1042+
1043+
A Name Constraints extension can have **Subtree** values of `Include` and `Exclude` to specify
1044+
included and excluded names.
1045+
1046+
You can specify the following tokens in a Name Constraints extension:
1047+
1048+
- **DirectoryName**: A distinguished name such as: `CN=Name,DC=Domain,DC=com`
1049+
- **DNS**: A computer name in the following format: `computer.contoso.com`
1050+
- **Email**: An email address, such as this example: `[email protected]`
1051+
- **IPAddress**: `{IPV4 address},{IPV4 subnet mask}` or `{IPV6 address},{IPV6 subnet mask}`
1052+
- **RegisteredID**: ID in dotted decimal notation, such as this example: `1.2.3.4.5`
1053+
- **UPN**: A user principal name in the following format: `[email protected]`
1054+
- **URL**: The URL of a host, such as this example: `http://computer07.contoso.com/index.html`
1055+
1056+
Policy Mapping extension example: `2.5.29.33={text}oid={oid}&oid={oid}...`
1057+
1058+
Subject Alternative Name extension example: `2.5.29.17={text}token=value&token=value...`
1059+
1060+
You can specify the following tokens in a Subject Alternative Name extension:
1061+
1062+
- **DirectoryName**: A distinguished name such as: `CN=Name,DC=Domain,DC=com`
1063+
- **DNS**: A computer name in the following format: `computer.contoso.com`
1064+
- **Email**: An email address, such as this example: `[email protected]`
1065+
- **GUID**: A globally unique ID, such as this example: `f7c3ac41-b8ce-4fb4-aa58-3d1dc0e36b39`
1066+
- **IPAddress**: `{IPV4 address},{IPV4 subnet mask}` or `{IPV6 address},{IPV6 subnet mask}`
1067+
- **RegisteredID**: ID in dotted decimal notation, such as this example: `1.2.3.4.5`
1068+
- **UPN**: A user principal name in the following format: `[email protected]`
1069+
- **URL**: The URL of a host, such as this example: `http://computer07.contoso.com/index.html`
11121070

11131071
```yaml
11141072
Type: System.String[]

0 commit comments

Comments
 (0)