Import-PfxCertificate

업데이트 날짜: 2015년 9월

Import-PfxCertificate

Imports certificates and private keys from a Personal Information Exchange (PFX) file to the destination store.

구문

Parameter Set: Default
Import-PfxCertificate [-FilePath] <String> [[-CertStoreLocation] <String> ] [-Exportable] [-Password <SecureString> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

자세한 설명

The Import-PfxCertificate cmdlet imports certificates and private keys from a PFX file to the destination store. Certificates with and without private keys in the PFX file are imported, along with any external properties that are present.

Delegation may be required when using this cmdlet with Windows PowerShell® remoting and changing user configuration.

매개 변수

-CertStoreLocation<String>

Specifies the path of the store to which certificates will be imported. If this parameter is not specified, then the current path is used as the destination store.

별칭

none

필수 여부

false

위치

2

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Exportable

Specifies whether the imported private key can be exported. If this parameter is not specified, then the private key cannot be exported.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-FilePath<String>

Specifies the path for the PFX file.

별칭

FullName

필수 여부

true

위치

1

기본값

none

파이프라인 입력 허용 여부

true (ByPropertyName)

와일드카드 문자 허용 여부

false

-Password<SecureString>

Specifies the password for the imported PFX file in the form of a secure string.

별칭

none

필수 여부

false

위치

named

기본값

none

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지를 표시합니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행되는 경우 발생할 결과를 보여 줍니다. cmdlet은 실행되지 않습니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 허용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable 등의 일반 매개 변수를 지원합니다. 자세한 내용은 TechNet의 about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216)

입력

입력 형식은 cmdlet으로 파이프할 수 있는 개체의 형식입니다.

  • System.String

    A String containing the path to the PFX file.

출력

출력 형식은 cmdlet 실행 시 출력되는 개체의 형식입니다.

  • System.Security.Cryptography.X509Certificates.X509Certificate2

    The imported X509Certificate2 object contained in the PFX file that is associated with private keys.

EXAMPLE 1

This example imports the PFX file my.pfx with a private non-exportable key into the My store for the machine account.

PS C:\> $mypwd = ConvertTo-SecureString -String "1234" -Force –AsPlainText
PS C:\> Import-PfxCertificate –FilePath C:\mypfx.pfx cert:\localMachine\my -Password $mypwd

EXAMPLE 2

This example imports the PFX file my.pfx with a private non-exportable key into the My store for the current user with private key exportable. The Password parameter is not required since this PFX file is not password protected.

PS C:\> Get-ChildItem -Path c:\mypfx\my.pfx | Import-PfxCertificate -CertStoreLocation Cert:\CurrentUser\My –Exportable

EXAMPLE 3

This example imports the PFX file mypfx.pfx into the My store for the machine account. The Password parameter is not required since this PFX file is protected using the domain account of this machine. This requires a Windows Server® 2012 domain controller.

PS C:\> Set-Location -Path cert:\localMachine\my
PS C:\> Import-PfxCertificate –FilePath c:\mypfx.pfx

관련 항목

Export-PfxCertificate

ConvertTo-SecureString

Get-ChildItem

Set-Location