Редагувати

Поділитися через


Get-PfxData

Extracts the content of a Personal Information Exchange (PFX) file into a structure without importing it to certificate store.

Syntax

Get-PfxData
   [-Password <SecureString>]
   [-FilePath] <String>
   [<CommonParameters>]

Description

The Get-PfxData cmdlet extracts the content of a Personal Information Exchange (PFX) file into a structure that contains the end entity certificate, and any intermediate and root certificates.

Examples

EXAMPLE 1

$mypwd = ConvertTo-SecureString -String '1234' -Force -AsPlainText

$mypfx = Get-PfxData -FilePath C:\mypfx.pfx -Password $mypwd

This example returns certificate information for the file C:\mypfx.pfx that is secured with the specified password.

EXAMPLE 2

$NewPwd = ConvertTo-SecureString -String 'abcd' -Force -AsPlainText

$mypfx = Get-PfxData -FilePath C:\mypfx.pfx -Password $OldPwd

Export-PfxCertificate -PfxData $mypfx -FilePath C:\mypfx.pfx -Password $NewPwd -Force

This example shows how one can change an existing password for mypfx.pfx file from $OldPwd to $NewPwd.

Parameters

-FilePath

Specifies the path to the PFX file.

Type:String
Aliases:FullName
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Password

Specifies the password for the imported PFX file.

Type:System.SecureString
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

A string containing the path to PFX file.

Outputs

Microsoft.CertificateServices.Commands.PFXData

A PFXData object.