update cbh blocks

This commit is contained in:
OCram85 2019-04-08 12:37:30 +02:00
parent b12d9ae063
commit 752a1f3ff8
10 changed files with 63 additions and 51 deletions

View File

@ -1,16 +1,16 @@
function Get-CSCertificate {
<#
.SYNOPSIS
Returns the current used valid PfX Certificate.
Returns the current used valid PfX certificate.
.DESCRIPTION
Use this function to get the available pfx certficate respecting the config hierarchy.
Use this function to get the available pfx certificate respecting the config hierarchy.
.PARAMETER Type
Select the current credential store type.
.PARAMETER Thumbprint
Provice the crednetials thumbprint for the search.
Provide the credentials thumbprint for the search.
.INPUTS
[None]
@ -22,9 +22,9 @@ function Get-CSCertificate {
Get-CSCertificate -Type 'Shared' -Thumbprint '12334456'
.NOTES
File Name : Get-CSCertificate.ps1
Author : Marco Blessing - marco.blessing@googlemail.com
Requires :
- File Name : Get-CSCertificate.ps1
- Author : Marco Blessing - marco.blessing@googlemail.com
- Requires :
.LINK
https://github.com/OCram85/PSCredentialStore

View File

@ -7,7 +7,7 @@ function Get-CSPfxCertificate {
You can use this function to get a stored certificate. Search for the object by its unique thumbprint.
.PARAMETER Thumbprint
Provide one or more thumprints.
Provide one or more thumbprints.
.PARAMETER StoreName
Select the store name in which you want to search the certificates.
@ -25,9 +25,9 @@ function Get-CSPfxCertificate {
Get-CSPfxCertificate -Thumbprint '12345678' -StoreName 'My' -StoreLocation 'CurrentUser'
.NOTES
File Name : Get-CSPfxCertificate.ps1
Author : Marco Blessing - marco.blessing@googlemail.com
Requires :
- File Name : Get-CSPfxCertificate.ps1
- Author : Marco Blessing - marco.blessing@googlemail.com
- Requires :
.LINK
https://github.com/OCram85/PSCredentialStore

View File

@ -1,13 +1,17 @@
function Import-CSCertificate {
<#
.SYNOPSIS
A brief description of the function or script.
Imports a linked certificate to the valid store location.
.DESCRIPTION
Describe the function of the script using a single sentence or more.
Import-CSCertificate takes a pfx certificate file and imports it to the supposed certificate store for
private and shared credential stores.
.PARAMETER One
Description of the Parameter (what it does)
.PARAMETER Type
Select between the a private and shared credential store.
.PARAMETER Path
Provide a valid path to pfx certificate file.
.INPUTS
Describe the script input parameters (if any), otherwise it may also list the word "[None]".
@ -19,9 +23,9 @@ function Import-CSCertificate {
.\Remove-Some-Script.ps1 -One content
.NOTES
File Name : Import-CSCertificate.ps1
Author : fullname - mail
Requires : ModuleNames
- File Name : Import-CSCertificate.ps1
- Author : Marco Blessing - marco.blessing@googlemail.com
- Requires :
.LINK
https://github.com/OCram85/PSCredentialStore
@ -52,7 +56,7 @@ function Import-CSCertificate {
}
process {
# Import to CurrentUser\My stor for windows and linux
# Import to CurrentUser\My store for windows and linux
if ($Type -eq 'Private') {
Import-CSPfxCertificate -Path $Path -StoreName 'My' -StoreLocation 'CurrentUser' -OpenFlags 'ReadWrite'
}

View File

@ -1,11 +1,11 @@
function Import-CSPfxCertificate {
<#
.SYNOPSIS
adds a given pfx certificate file to current uerers personal certificate store.
Adds a given pfx certificate file to current user's personal certificate store.
.DESCRIPTION
This function is used to import existing pfx certificate files. The Import-PFXCertificate cmdle from the
PKI module imports the certficate into a deprecated store. Thus you can't read the private key afterwards or
This function is used to import existing pfx certificate files. The Import-PFXCertificate cmdlet from the
PKI module imports the certificate into a deprecated store. Thus you can't read the private key afterwards or
using it for decrypting data.
.PARAMETER Path
@ -64,7 +64,7 @@ function Import-CSPfxCertificate {
'ReadWrite',
'MaxAllowed',
'OpenExistingOnly',
'InclueArchived'
'IncludeArchived'
)]
[string]$OpenFlags = 'ReadWrite'
)

View File

@ -1,13 +1,13 @@
function New-CSCertAttribute {
<#
.SYNOPSIS
Create required data for a certificate signing request.
Creates required data for a certificate signing request.
.DESCRIPTION
Defines the certificate related properties for an upcoming New-PfxCertificate execution.
.PARAMETER Country
Provide a two letter country code.
County code like EN, DE, IT, FR...
.PARAMETER State
Certificate state value.
@ -35,12 +35,12 @@ function New-CSCertAttribute {
['PSCredentialStore.Certificate.CSRDetails']
.EXAMPLE
New-CSCertAttribute -CSRSubject @{Country = 'DE'; State = 'BW'; City = 'Karlsruhe'; Organization = 'AwesomeIT'; OrganizationalUnitName = '';CommonName = 'MyPrivateCert'}
New-CSCertAttribute -Country 'DE' -State 'BW' -City 'Karlsruhe' -Organization 'AwesomeIT' -OrganizationalUnitName '' -CommonName 'MyPrivateCert'
.NOTES
File Name : New-CSCertAttribute.ps1
Author : Marco Blessing - marco.blessing@googlemail.com
Requires :
- File Name : New-CSCertAttribute.ps1
- Author : Marco Blessing - marco.blessing@googlemail.com
- Requires :
.LINK
https://github.com/OCram85/PSCredentialStore

View File

@ -25,9 +25,9 @@ function New-CSCertificate {
New-CSCertificate -CRTAttribute $CRTAttribute -KeyName './myprivate.key' -CertName './mycert.pfx'
.NOTES
File Name : New-CSCertificate.ps1
Author : Marco Blessing - marco.blessing@googlemail.com
Requires :
- File Name : New-CSCertificate.ps1
- Author : Marco Blessing - marco.blessing@googlemail.com
- Requires :
.LINK
https://github.com/OCram85/PSCredentialStore

View File

@ -1,10 +1,10 @@
function Test-CSCertificate {
<#
.SYNOPSIS
Tests if the linked certificate is stor ein the specified cert stores.
Tests if the linked certificate is store ein the specified cert stores.
.DESCRIPTION
Test-CSCertficate should be an easy high level test for the linked certificate.
Test-CSCertificate should be an easy high level test for the linked certificate.
.PARAMETER Type
Select between 'Private' or 'Shared'.
@ -16,12 +16,12 @@ function Test-CSCertificate {
[bool]
.EXAMPLE
.\Remove-Some-Script.ps1 -One content
Test-CSCertificate -Type 'Shared'
.NOTES
File Name : Test-CSCertificate.ps1
Author : Marco Blessin - marco.blessing@googlemail.com
Requires :
- File Name : Test-CSCertificate.ps1
- Author : Marco Blessing - marco.blessing@googlemail.com
- Requires :
.LINK
https://github.com/OCram85/PSCredentialStore
@ -42,7 +42,7 @@ function Test-CSCertificate {
$CS = Get-CredentialStore -Shared
}
if ($null -ne $CS.PfxCertificate) {
Write-Warning 'There is a Pfx certificate file linked in the store. Certifcates saved in the Cert store will be ignored!'
Write-Warning 'There is a Pfx certificate file linked in the store. Certificates saved in the Cert store will be ignored!'
}
}

View File

@ -7,7 +7,7 @@ function Test-CSPfxCertificate {
Use this function to ensure if a certificate is already imported into a given store.
.PARAMETER Thumbprint
Provide one or more thumprints.
Provide one or more thumbprints.
.PARAMETER StoreName
Select the store name in which you want to search the certificates.
@ -22,10 +22,10 @@ function Test-CSPfxCertificate {
[bool]
.EXAMPLE
Test-CSPfxCertificat -Thumbprint '12345678' -StoreName 'My' -StoreLocation 'CurrentUser'
Test-CSPfxCertificate -Thumbprint '12345678' -StoreName 'My' -StoreLocation 'CurrentUser'
.NOTES
File Name : Test-CSPfxCertificat.ps1
File Name : Test-CSPfxCertificate.ps1
Author : Marco Blessing - marco.blessing@googlemail.com
Requires :

View File

@ -1,7 +1,7 @@
function Use-CSCertificate {
<#
.SYNOPSIS
Links an existing PFX Certifiacte to a CredentialStore.
Links an existing PFX Certificate to a CredentialStore.
.DESCRIPTION
Linking a certificate is needed if you plan to use the same CredentialStore in cross platform scenarios.
@ -9,6 +9,15 @@ function Use-CSCertificate {
.PARAMETER Path
Specify the path to the PFX Certificate you want to link for usage.
.PARAMETER CredentialStore
Specify a custom path for a shared credential store.
.PARAMETER Shared
Use the credential store in shared mode.
.PARAMETER UserCertStore
Use the given certificate and import it into the corresponding certificate store.
.INPUTS
[None]
@ -16,7 +25,7 @@ function Use-CSCertificate {
[None]
.EXAMPLE
Use-CSCertificate -Path 'C:\cert.pfx'
.NOTES
File Name : Use-CSCertificate.ps1
@ -98,7 +107,7 @@ Make sure you used the same AES keys for encrypting!
}
if ($UseCertStore) {
Import-CSCertificate -Type ($PSCmdlet.ParameterSetName -eq "Private") -Path $Path
Import-CSCertificate -Type $PSCmdlet.ParameterSetName -Path $Path
$CS.Thumbprint = $PfxCertificate.Thumbprint
$CS.PfxCertificate = $null
}

View File

@ -11,8 +11,8 @@ function Get-CredentialStoreItem {
Specify the host, for which you would like to change the credentials.
.PARAMETER Identifier
Provide a custom identifier to the given remote host key. This enables you to store multiple credentials
for a single remote host entry. For example ad/sys1, ftp/sys1, mssql/sys1
Provide a custom identifier to the given remote host key. This enables you to store multiple credentials
for a single remote host entry. For example ad/sys1, ftp/sys1, mssql/sys1
.PARAMETER Path
Define a custom path to a shared CredentialStore.
@ -31,11 +31,10 @@ function Get-CredentialStoreItem {
$myCreds = Get-CredentialStoreItem -Path "C:\TMP\mystore.json" -RemoteHost "esx01.myside.local"
.NOTES
```
File Name : Get-CredentialStoreItem.ps1
Author : Marco Blessing - marco.blessing@googlemail.com
Requires :
```
- File Name : Get-CredentialStoreItem.ps1
- Author : Marco Blessing - marco.blessing@googlemail.com
- Requires : dfgdfg
.LINK
https://github.com/OCram85/PSCredentialStore
#>