Generate Self Signed Certificate With Private Key
Apr 12, 2020 With openssl self signed certificate you can generate private key with and without passphrase. If you use any type of encryption while creating private key then you will have to provide passphrase every time you try to access private key. With the encrypted password file we can avoid entering the password when we create self signed certificate. Generate a Self Signed Certificate using Java Keytool Now that you know when to use a Keytool self signed certificate, let's create one using a simple Java Keytool command: Open the command console on whatever operating system you are using and navigate to the directory where keytool.exe is located (usually where the JRE is located, e.g.
Important: This example is intended to provide general guidance to IT professionals who are experienced with SSL requirements and configuration. The procedure described in this article is just one of many available methods you can use to generate the required files. The process described here should be treated as an example and not as a recommendation.
When you configure Tableau Server to use Secure Sockets Layer (SSL) encryption, this helps ensure that access to the server is secure and that data sent between Tableau Server and Tableau Desktop is protected.
Looking for Tableau Server on Linux? See Example: SSL Certificate - Generate a Key and CSR.
Tableau Server uses Apache, which includes OpenSSL. You can use the OpenSSL toolkit to generate a key file and Certificate Signing Request (CSR) which can then be used to obtain a signed SSL certificate.
Steps to generate a key and CSR
To configure Tableau Server to use SSL, you must have an SSL certificate. To obtain the SSL certificate, complete the steps:
- Generate a key file.
- Create a Certificate Signing Request (CSR).
- Send the CSR to a certificate authority (CA) to obtain an SSL certificate.
- Use the key and certificate to configure Tableau Server to use SSL.
You can find additional information on the SSL FAQ page on the Apache Software Foundation website.
Configure a certificate for multiple domain names
Tableau Server allows SSL for multiple domains. To set up this environment, you need to modify the OpenSSL configuration file, openssl.conf, and configure a Subject Alternative Name (SAN) certificate on Tableau Server. See For SAN certificates: modify the OpenSSL configuration file below.
Set the OpenSSL configuration environment variable (optional)
To avoid using the -config
argument with every use of openssl.exe, you can use the OPENSSL_CONF
environment variable to ensure that the correct configuration file is used and all configuration changes made in subsequent procedures in this article produce expected results (for example, you must set the environment variable to add a SAN to your certificate).
Open the Command Prompt as an administrator, and run the following command:
set OPENSSL_CONF=c:Program FilesTableauTableau Serverpackagesapache.<version_code>confopenssl.cnf
Notes:
When setting the Open SSL configuration environment variable, do not enclose the file path with quotation marks.
If you are using a 32-bit version of Tableau Server on a 64-bit computer, run the
set OPENSSL_CONF=c:Program Files (x86)TableauTableau Serverpackagesapache.<version_code>confopenssl.cnf
command instead.
Generate a key
Generate a key file that you will use to generate a certificate signing request.
Open the Command Prompt as an administrator, and navigate to the Apache directory for Tableau Server. For example, run the following command:
cd C:Program FilesTableauTableau Serverpackagesapache.<version_code>bin
Run the following command to create the key file:
openssl.exe genrsa -out <yourcertname>.key 4096
Note: This command uses a 4096-bit length for the key. You should choose a bit length that is at least 2048 bits because communication encrypted with a shorter bit length is less secure. If a value is not provided, 512 bits is used.
Create a certificate signing request to send to a certificate authority
Use the key file you created in the procedure above to generate the certificate signing request (CSR). You send the CSR to a certificate authority (CA) to obtain a signed certificate.
Important: If you want to configure a SAN certificate to use SSL for multiple domains, first complete the steps in For SAN certificates: modify the OpenSSL configuration file below, and then return to here to generate a CSR.
Run the following command to create a certificate signing request (CSR) file:
openssl.exe req -new -key yourcertname.key -out yourcertname.csr
If you did not set the OpenSSL configuration environment variable,
OPENSSL_CONF
, you might see either of the following messages:An error message about the config information being unable to load. In this case, retype the command above with the following parameter:
-config ..confopenssl.cnf
.A warning that the
/usr/local/ssl
directory cannot be found. This directory does not exist on Windows, and you can simply ignore this message. The file is created successfully.
To set an OpenSSL configuration environment variable, see Set the OpenSSL configuration environment variable (optional) section in this article.
When prompted, enter the required information.
Note: For Common Name, type the Tableau Server name. The Tableau Server name is the URL that will be used to reach the Tableau Server. For example, if you reach Tableau Server by typing
tableau.example.com
in the address bar of your browser, thentableau.example.com
is the common name. If the common name does not resolve to the server name, errors will occur when a browser or Tableau Desktop tries to connect to Tableau Server.
Send the CSR to a certificate authority to obtain an SSL certificate
Send the CSR to a commercial certificate authority (CA) to request the digital certificate. For information, see the Wikipedia article Certificate authority and any related articles that help you decide which CA to use.
Use the key and certificate to configure Tableau Server
When you have both the key and the certificate from the CA, you can configure Tableau Server to use SSL. For the steps, see Configure External SSL.
For SAN certificates: modify the OpenSSL configuration file
In a standard installation of OpenSSL, some features are not enabled by default. To use SSL with multiple domain names, before you generate the CSR, complete these steps to modify the openssl.cnf file.
Open Windows Explorer and browse to the Apache conf folder for Tableau Server.
For example:
C:Program FilesTableauTableau Server<version_code>apacheconf
Open openssl.cnf in a text editor, and find the following line:
req_extensions = v3_req
This line might be commented out with a hash sign (#) at the beginning of the line.
If the line is commented out, uncomment it by removing the # and space characters from the beginning of the line.
Move to the [ v3_req ] section of the file. The first few lines contain the following text:
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEnciphermentAfter the keyUsage line, insert the following line:
subjectAltName = @alt_names
If you’re creating a self-signed SAN certificate, do the following to give the certificate permission to sign the certificate:
Add the
cRLSign
andkeyCertSign
to the keyUsage line so it looks like the following:keyUsage = nonRepudiation, digitalSignature, keyEncipherment, cRLSign, keyCertSign
After the keyUsage line, add the following line:
subjectAltName = @alt_names
In the [alt_names] section, provide the domain names you want to use with SSL.
DNS.1 = [domain1]
DNS.2 = [domain2]
DNS.3 = [etc]The following image shows the results highlighted, with placeholder text that you would replace with your domain names.
Save and close the file.
Complete the steps in Create a certificate signing request to send to a certificate authority section, above.
Additional information
If you prefer to use a different version of OpenSSL, you can download it from Open SSL for Windows.
Syntax
Description
The New-SelfSignedCertificate cmdlet creates a self-signed certificate for testing purposes.Using the CloneCert parameter, a test certificate can be created based on an existing certificate with all settings copied from the original certificate except for the public key.The cmdlet creates a new key of the same algorithm and length.
Delegation may be required when using this cmdlet with Windows PowerShell remoting and changing user configuration.
Examples
EXAMPLE 1
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.
EXAMPLE 2
This example creates a copy of the certificate specified by the CloneCert parameter and puts it in the computer MY store.
EXAMPLE 3
This example creates a self-signed S/MIME 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.This certificate has the subject alternative names of patti.fuller@contoso.com as RFC822 and pattifuller@contoso.com as Principal Name.
This command does not specify the NotAfter parameter.Therefore, the certificate expires in one year.
EXAMPLE 4
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 certificate has a subject alternative name of pattifuller@contoso.com.
The certificate expires in one year.
EXAMPLE 5
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 elliptic curve asymmetric key and the curve parameters nist256, which creates a 256-bit key.The subject alternative name is pattifuller@contoso.com.
The certificate expires in one year.
EXAMPLE 6
This example creates a self-signed client authentication certificate in the user MY store.The certificate uses the Microsoft Platform Crypto Provider.This provider uses the Trusted Platform Module (TPM) of the device to create the asymmetric key.The key is an RSA 2048-bit key that cannot be exported.The subject alternative name is pattifuller@contoso.com.The certificate expires in one year.
EXAMPLE 7
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.
EXAMPLE 8
This example creates a self-signed S/MIME 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.This certificate has the subject alternative names of patti.fuller@contoso.com and pattifuller@contoso.com both as RFC822.
This command does not specify the NotAfter parameter.Therefore, the certificate expires in one year.
EXAMPLE 9
This example creates a self-signed SSL server certificate with Subject and Issuer name set to localhost
and with subject alternative name set to IPAddress 127.0.0.1
and ::1
via TextExtension.
Parameters
Indicates that this cmdlet uses RSA-PSS (PKCSv2.1) or an elliptic curve cryptography (ECC) equivalent.If you do not specify this parameter, the cmdlet uses the default, RSA-PSS (PKCSv1.5) or an ECC equivalent.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the certificate store in which to store the new certificate.If the current path is Cert:CurrentUser or Cert:CurrentUserMy, the default store is Cert:CurrentUserMy.If the current path is Cert:LocalMachine or Cert:LocalMachineMy, the default store is Cert:LocalMachineMy.Otherwise, you must specify Cert:CurrentUserMy or Cert:LocalMachineMy for this parameter.This parameter does not support other certificate stores.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Identifies the certificate to copy when creating a new certificate.The certificate being cloned can be identified by an X509 certificate or the file path in the certificate provider.When this parameter is used, all fields and extensions of the certificate will be inherited except the public key, a new key of the same algorithm and length will be created, and the NotAfter and NotBefore fields.The default validity period will be the same as the certificate to copy, except that the NotBefore field will be set to ten minutes in the past.
Type: | Certificate |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByValue) |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of the container in which this cmdlet stores the key for the new certificate.
When you create a key, a trailing asterisk (*) indicates that the rest of the container name string is a prefix.An appended GUID string makes the container name unique.
When you use an existing key, the container name must identify an existing key.You may also have to specify the provider.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies how the public key parameters for an elliptic curve key are represented in the new certificate.The acceptable values for this parameter are:
- CurveParameters
- CurveName
- None (default)
The default value, None, indicates that this cmdlet uses the default value from the underlying key storage provider (KSP).This parameter is not supported with the RSA algorithm or with cryptographic service providers (CSPs).
Type: | CurveParametersExportType |
Accepted values: | None, CurveParameters, CurveName |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies one or more DNS names to put into the subject alternative name extension of the certificate when a certificate to be copied is not specified via the CloneCert parameter.The first DNS name is also saved as the Subject Name.If no signing certificate is specified, the first DNS name is also saved as the Issuer Name.
Type: | String[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indicates that this cmdlet uses an existing key.If you do not specify this parameter, this cmdlet creates a new key.Creating a certificate from an existing key creates a new key with a new container.
When you use an existing key, specify values for the Container parameter, the Provider parameter, and the CertStoreLocation parameter.CertStoreLocation determines the context.The context is user or computer.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies an array of certificate extensions, as X509Extension objects, that this cmdlet includes in the new certificate.
Type: | X509Extension[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a friendly name for the new certificate.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies how a hardware key associated with the new certificate may be used.This parameter applies only when you specify the Microsoft Platform Crypto Provider.The acceptable values for this parameter are:
- None (default)
- SignatureKey
- EncryptionKey
- GenericKey
- StorageKey
- IdentityKey
The default value, None, indicates that this cmdlet uses the default value from the underlying KSP.
Type: | HardwareKeyUsage[] |
Accepted values: | None, SignatureKey, EncryptionKey, GenericKey, StorageKey, IdentityKey |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of the hash algorithm to use to sign the new certificate.The default hash algorithm depends on the provider that stores the private key used to sign the new certificate.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of the algorithm that creates the asymmetric keys that are associated with the new certificate.Available asymmetric key algorithms are RSA and Elliptic Curve Digital Signature Algorithms (ECDSA).
The elliptic curve algorithm syntax is the following:
ECDSA_
curvename
To obtain a value for curvename, use the certutil -displayEccCurve
command.
Valid curve names contain a value in the Curve OID column in the output of the certutil -displayEccCurve
command.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a description for the private key that is associated with the new certificate.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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
The default value of ExportableEncrypted is not compatible with KSP and CSPs that do not allow key export.These include the Microsoft Smart Card Key Storage Provider and the Microsoft Platform Crypto Key Storage Provider.Specify NonExportable for providers that do not allow key export.
Type: | KeyExportPolicy[] |
Accepted values: | NonExportable, ExportableEncrypted, Exportable |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a friendly name for the private key that is associated with the new certificate.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the length, in bits, of the key that is associated with the new certificate.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the file system location where this cmdlet stores the private keys associated with the new certificate.Specify this parameter only when you specify the Microsoft Platform Crypto Provider.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the level of protection required to access the private key that is associated with the certificate.The acceptable values for this parameter are:
- Protect
- ProtectHigh
- ProtectFingerPrint
- None (default)
The default value, None, indicates that this cmdlet uses the default value from the underlying KSP or CSP.For most KSPs and CSPs, the default means that no user interface is required to create and use the private key.A user interface is required if the provider always requires a user interface, such as a smart card, or if the default configuration of the provider has been changed.
Type: | KeyProtection[] |
Accepted values: | None, Protect, ProtectHigh, ProtectFingerPrint |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies whether the private key associated with the new certificate can be used for signing, encryption, or both.The acceptable values for this parameter are:
- KeyExchange
- Signature
- None (default)
The default value, None, indicates that this cmdlet uses the default value from the underlying CSP.
If the private key is managed by a legacy CSP, the value is KeyExchange or Signature.If the key is managed by a Cryptography Next Generation (CNG) KSP, the value is None.
Type: | KeySpec |
Accepted values: | None, KeyExchange, Signature |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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
The value, None, indicates that this cmdlet does not include the KeyUsage extension in the new certificate.
Type: | KeyUsage[] |
Accepted values: | None, EncipherOnly, CRLSign, CertSign, KeyAgreement, DataEncipherment, KeyEncipherment, NonRepudiation, DigitalSignature, DecipherOnly |
Position: | Named |
Default value: | DigitalSignature,KeyEncipherment |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the key usages for the key usages property of the private key.The acceptable values for this parameter are:
- All
- Decrypt
- KeyAgreement
- None (default)
- Sign
The default value, None, indicates that this cmdlet uses the default value from the underlying KSP.
How To Use A Self Signed Certificate
Type: | KeyUsageProperty[] |
Accepted values: | None, Decrypt, Sign, KeyAgreement, All |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the date and time, as a DateTime object, that the certificate expires.To obtain a DateTime object, use the Get-Date cmdlet.The default value for this parameter is one year after the certificate was created.
Type: | DateTime |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the date and time, as a DateTime object, when the certificate becomes valid.The default value for this parameter is 10 minutes before the certificate was created.
Type: | DateTime |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the personal identification number (PIN) used to access the private key of the new certificate.
Type: | SecureString |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of the KSP or CSP that this cmdlet uses to create the certificate. See Cryptographic Providers for more information.Some acceptable values include:
- Microsoft Software Key Storage Provider
- Microsoft Smart Card Key Storage Provider
- Microsoft Platform Crypto Provider
- Microsoft Strong Cryptographic Provider
- Microsoft Enhanced Cryptographic Provider v1.0
- Microsoft Enhanced RSA and AES Cryptographic Provider
- Microsoft Base Cryptographic Provider v1.0
- The name of a third party KSP or CSP
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of the smart card reader on which to store the private key for the new certificate.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the private key security descriptor as a FileSecurity object.Read access is required to use the private key.This parameter does not apply to providers that do not support security descriptors on private keys, including the smart card CSP and smart card KSP.
Type: | FileSecurity |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a serial number, as a hexadecimal string, that is associated with the new certificate.If you do not specify this parameter, this cmdlet assigns a pseudo-randomly generated 16 byte value.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a Certificate object with which this cmdlet signs the new certificate.This value must be in the Personal certificate store of the user or device.This cmdlet must have read access to the private key of the certificate.
Type: | Certificate |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the PIN that is required to access the private key of the certificate that is used to sign the new certificate.
Type: | SecureString |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the name of the smart card reader that is used to sign the new certificate.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indicates that the new certificate includes available encryption algorithms to a Secure/Multipurpose Internet Mail Extensions (S/MIME) capabilities extension.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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 (;).
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies an array of object identifier (also known as OID) strings that identify default extensions to be removed from the new certificate.
Type: | String[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indicates that this cmdlet signs the new certificate by using a built-in test certificate.This cmdlet adds the built-in test certificate to the intermediate certification authority (CA) certificate store of the device.
This parameter is for test purposes only.The private key of the test root certificate is essentially public.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies an array of certificate extensions, as strings, which this cmdlet includes in the new certificate.Each string must employ one of the following formats:
oid=
base64String, where oid is the object identifier of the extension and base64String is a value that you provide.After decoding base64String, the value must be valid Abstract Syntax Notation One (ASN.1).For more information, see Abstract Syntax Notation One (ASN.1): Specification of basic notation.
oid={hex}
hexidecimalString, where oid is the object identifier of the extension and hexidecimalString is a value that you provide.After decoding hexidecimalString, the value must be valid ASN.1.
oid={text}
String, where oid is the object identifier of the extension and String is a value that you provide.String must contain a textual representation of the extension value in a format specific to each object ID.When String is processed, it will be encoded into an ASN.1 extension value before being placed into the new certificate as an extension.
To specify that an extension is critical, insert {critical} immediately following oid=
in any of the previous cases.
The object identifiers of some common extensions are as follows:
- Application Policy.1.3.6.1.4.1.311.21.10
- Application Policy Mappings.1.3.6.1.4.1.311.21.11
- Basic Constraints.2.5.29.19
- Certificate Policies.2.5.29.32
- Enhanced Key Usage.2.5.29.37
- Name Constraints.2.5.29.30
- Policy Mappings.2.5.29.33
- Subject Alternative Name.2.5.29.17
Application Policy1.3.6.1.4.1.311.21.10={text}token=value&token=value…The tokens have the following possible values:
Generate Self Signed Certificate Linux
- Flags.0xhexidecimalNumber
- GUID.A globally unique ID, such as this example: f7c3ac41-b8ce-4fb4-aa58-3d1dc0e36b39
- Notice.Text notice
- OID.Object identifier in dotted decimal notation, such as this example: 1.2.3.4.5
- URL.The URL of a host, such as this example: http://computer07.contoso.com
To specify an Application Policy extension, specify the first object identifier, followed by zero or more other token=value entries.These entries are subordinate to the preceding object identifier.Specify subsequent object identifiers, each followed by its subordinate token=value entries.
Application Policy Mappings1.3.6.1.4.1.311.21.11={text}oid=oid&oid=oid…
Certificate Policies2.5.29.32={text}token=value&token=value…The tokens have the following possible values:
- Flags.0xhexidecimalNumber
- GUID.A globally unique ID, such as this example: f7c3ac41-b8ce-4fb4-aa58-3d1dc0e36b39
- Notice.Text notice
- OID.Object ID in dotted decimal notation, such as this example: 1.2.3.4.5
- URL.The URL of a host, such as this example: http://computer07.contoso.com
To specify a Certificate Policies extension, follow the same syntax as an Application Policy extension.
Enhanced Key Usage Object Identifiers2.5.29.37={text}oid,oid…These key usages have the following object identifiers:
- Client Authentication.1.3.6.1.5.5.7.3.2
- Server Authentication.1.3.6.1.5.5.7.3.1
- Secure Email.1.3.6.1.5.5.7.3.4
- Code Signing.1.3.6.1.5.5.7.3.3
- Timestamp Signing.1.3.6.1.5.5.7.3.8
Name Constraints2.5.29.30={text}subtree=subtreeValue&token=value&token=value& …&subtree=subtreeValue&token=value&token=value…The subtreeValue can have the following values:
- Include.Permitted names
- Exclude.Excluded names
The tokens have the following possible values:
- DirectoryName.CN=Name,DC=Domain,DC=com
- DNS.A computer name in the following format: computer.contoso.com
- Email.An email address, such as this example: admin@contoso.com
- IPAddress.IPV4 address,IPV4 subnet mask or IPV6 address,IPV6 subnet mask
- RegisteredID.ID in dotted decimal notation, such as this example: 1.2.3.4.5
- UPN.A user principal name in the following format: admin@contoso.com
- URL.The URL of a host, such as this example: http://computer07.contoso.com/index.html
Policy Mapping2.5.29.33={text}oid=oid&oid=oid…
Subject Alternative Name Syntax2.5.29.17={text}token=value&token=value…The tokens have the following possible values:
- UPN.A user principal name in the following format: admin@contoso.com
- Email.An email address, such as this example: admin@contoso.com
- DNS.A computer name in the following format: computer.contoso.com
- DirectoryName.CN=Name,DC=Domain,DC=com
- URL.The URL of a host, such as this example: http://computer07.contoso.com/index.html
- IPAddress.An IP address
- RegisteredID.ID in dotted decimal notation, such as this example: 1.2.3.4.5
- GUID.A globally unique ID, such as this example: f7c3ac41-b8ce-4fb4-aa58-3d1dc0e36b39
Type: | String[] |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies the type of certificate that this cmdlet creates.The acceptable values for this parameter are:
- CodeSigningCert
- Custom
- DocumentEncryptionCert
- DocumentEncryptionCertLegacyCsp
- SSLServerAuthentication (default)
Type: | CertificateType |
Accepted values: | Custom, CodeSigningCert, DocumentEncryptionCert, SSLServerAuthentication, DocumentEncryptionCertLegacyCsp |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs.The cmdlet is not run.
Create Self Signed Certificate With Private Key Iis
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Windows Powershell Create Self Signed Certificate With Private Key
Inputs
Microsoft.CertificateServices.Commands.Certificate
Generate Self Signed Certificate Powershell
The Certificate object can either be provided as a Path object to a certificate or an X509Certificate2 object.
Outputs
System.Security.Cryptography.X509Certificates.X509Certificate2
Generate Self Signed Certificate With Private Keys
An X509Certificate2 object for the certificate that has been created.