< Back
New-HostCert
Post
NAME New-HostCert
SYNOPSIS
Creates certificates for a host using existing PowerShell CryptoStudio RootCA and SubCAs
Version 2.1.0.4
SYNTAX
New-HostCert [-HostName] <String> [[-SANName] <Array>] [-FriendlyName] <String> [-HostKeyLength] <Int32>
[-InstallCertLocal] [[-DaysVaild] <Int32>] [<CommonParameters>]
DESCRIPTION
Creates two certificates for a host (using SubCA01 and SubCa02). Stores both public and private keys in
Documents\\MyCerts folder
PARAMETERS
-HostName <String>
Specifies the subject name for the host. This is also included in the Subject Alternate Names (SAN) list.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-SANName <Array>
Specifies the FQDN of the host. Multiple hosts can be declared seperated by commas
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-FriendlyName <String>
Specifies the 'friendly name' of the certificate
Required? true
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
-HostKeyLength <Int32>
Specifies the length of the Host key- valid values are 1, 2, 4, 8, 16 (to be multiplied by 1K or 1024)
Required? true
Position? 4
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
-InstallCertLocal [<SwitchParameter>]
Switch to determine if certificates should be installed in local cert store.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-DaysVaild <Int32>
Required? false
Position? 5
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None.
OUTPUTS
NOTES
Requirements: Windows 10 17.09 or better or Server 2016 or better
Requirements: Windows PowerShell 5.1
Max Encrypt size RSA ((KeySize - 384) / 8) + 37
However, if the optimal asymmetric encryption padding (OAEP) parameter is true, the following can be used to
calculate the max bytes: ((KeySize - 384) / 8) + 7
-------------------------- EXAMPLE 1 --------------------------
PS>New-HostCert -HostName "myhost.com" -SANName "vpn.myhost.com", "mail.myhost.com", "remote.myhost.com"
-FriendlyName "My Test Cert" -HostkeyLength 4 -InstallCertLocal -DaysValid 200
RELATED LINKS
SYNOPSIS
Creates certificates for a host using existing PowerShell CryptoStudio RootCA and SubCAs
Version 2.1.0.4
SYNTAX
New-HostCert [-HostName] <String> [[-SANName] <Array>] [-FriendlyName] <String> [-HostKeyLength] <Int32>
[-InstallCertLocal] [[-DaysVaild] <Int32>] [<CommonParameters>]
DESCRIPTION
Creates two certificates for a host (using SubCA01 and SubCa02). Stores both public and private keys in
Documents\\MyCerts folder
PARAMETERS
-HostName <String>
Specifies the subject name for the host. This is also included in the Subject Alternate Names (SAN) list.
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-SANName <Array>
Specifies the FQDN of the host. Multiple hosts can be declared seperated by commas
Required? false
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false
-FriendlyName <String>
Specifies the 'friendly name' of the certificate
Required? true
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false
-HostKeyLength <Int32>
Specifies the length of the Host key- valid values are 1, 2, 4, 8, 16 (to be multiplied by 1K or 1024)
Required? true
Position? 4
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
-InstallCertLocal [<SwitchParameter>]
Switch to determine if certificates should be installed in local cert store.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-DaysVaild <Int32>
Required? false
Position? 5
Default value 0
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None.
OUTPUTS
NOTES
Requirements: Windows 10 17.09 or better or Server 2016 or better
Requirements: Windows PowerShell 5.1
Max Encrypt size RSA ((KeySize - 384) / 8) + 37
However, if the optimal asymmetric encryption padding (OAEP) parameter is true, the following can be used to
calculate the max bytes: ((KeySize - 384) / 8) + 7
-------------------------- EXAMPLE 1 --------------------------
PS>New-HostCert -HostName "myhost.com" -SANName "vpn.myhost.com", "mail.myhost.com", "remote.myhost.com"
-FriendlyName "My Test Cert" -HostkeyLength 4 -InstallCertLocal -DaysValid 200
RELATED LINKS