Skip to content

Commit

Permalink
Add support for more subject alternative names (SAN) (#14)
Browse files Browse the repository at this point in the history
* Add support for more subject alternative names (SAN)

* update comments
fix shouldprocess
fix SAN validation
fix template creation defect
update verbose output

* fixed first SAN

* renamed function to "New-CertificateSigningRequest"
added alias "New-CSR" to preserve backwards compatibility

* updated comments
  • Loading branch information
johnsarie27 committed Mar 8, 2024
1 parent 3411806 commit 02d4929
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 213 deletions.
10 changes: 7 additions & 3 deletions PS.SSL.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
RootModule = 'PS.SSL.psm1'

# Version number of this module.
ModuleVersion = '0.2.1'
ModuleVersion = '0.2.2'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -85,10 +85,14 @@
CmdletsToExport = @()

# Variables to export from this module
VariablesToExport = @()
VariablesToExport = @(
'CSR_Template'
)

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = @()
AliasesToExport = @(
'New-CSR'
)

# DSC resources to export from this module
# DscResourcesToExport = @()
Expand Down
8 changes: 2 additions & 6 deletions PS.SSL.psm1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ==============================================================================
# Filename: PS.SSL.psm1
# Version: 0.1.4 | Updated: 2022-10-21
# Updated: 2024-03-08
# Author: Justin Johns
# ==============================================================================

Expand Down Expand Up @@ -50,13 +50,9 @@ New-Variable -Name 'CSR_Template' -Option ReadOnly -Value @(
'extendedKeyUsage = serverAuth'
'subjectAltName = @alt_names'
'[alt_names]'
'DNS.1 = #CN#'
'DNS.2 = #SAN1#'
'DNS.3 = #SAN2#'
'DNS.4 = #SAN3#'
)

# EXPORT MEMBERS
# THESE ARE SPECIFIED IN THE MODULE MANIFEST AND THEREFORE DON'T NEED TO BE LISTED HERE
#Export-ModuleMember -Function *
Export-ModuleMember -Variable 'CSR_Template'
Export-ModuleMember -Variable 'CSR_Template' -Alias 'New-CSR'
193 changes: 0 additions & 193 deletions Public/New-CSR.ps1

This file was deleted.

Loading

0 comments on commit 02d4929

Please sign in to comment.