Export-Certificate
업데이트 날짜: 2015년 9월
Export-Certificate
Exports a certificate from a certificate store into a file.
구문
Parameter Set: Default
Export-Certificate -Cert <Certificate> -FilePath <String> [-Force] [-NoClobber] [-Type <CertType> {SST | CERT | P7B} ] [-Confirm] [-WhatIf] [ <CommonParameters>]
자세한 설명
The Export-Certificate cmdlet exports a certificate from a certificate store to a file. The private key is not included in the export. If more than one certificate is being exported, then the default file format is SST. Otherwise, the default format is CERT. Use the Type parameter to change the file format.
매개 변수
-Cert<Certificate>
Specifies one or more certificates to be exported to a file. A single certificate object, an array of certificate objects, or a path to one or more certificates in a certificate store can be specified.
별칭 |
none |
필수 여부 |
true |
위치 |
named |
기본값 |
none |
파이프라인 입력 허용 여부 |
true (ByValue) |
와일드카드 문자 허용 여부 |
false |
-FilePath<String>
Specifies the location where the exported certificate will be stored.
별칭 |
FullName |
필수 여부 |
true |
위치 |
named |
기본값 |
none |
파이프라인 입력 허용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Force
Specifies that the exported certificate file will overwrite an existing certificate file, unless the Read-only or hidden attribute is set or the NoClobber parameter is also used. The NoClobber parameter takes precedence over this parameter when both are used.
별칭 |
none |
필수 여부 |
false |
위치 |
named |
기본값 |
none |
파이프라인 입력 허용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-NoClobber
Prevents an exported certificate file from overwriting an existing certificate file. This parameter takes precedence over the Force parameter, which permits this cmdlet to overwrite an existing certificate file, even if it has the Read-only attribute set.
별칭 |
none |
필수 여부 |
false |
위치 |
named |
기본값 |
none |
파이프라인 입력 허용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-Type<CertType>
Specifies the type of output file for the certificate export as follows.
-- SST: A Microsoft serialized certificate store (.sst) file format which can contain one or more certificates. This is the default value for multiple certificates.
-- CERT: A .cer file format which contains a single DER-encoded certificate. This is the default value for one certificate.
-- P7B: A PKCS#7 file format which can contain one or more certificates.
별칭 |
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.Security.Cryptography.X509Certificates.X509Certificate2
A Certificate object can be piped into to this cmdlet.
출력
출력 형식은 cmdlet 실행 시 출력되는 개체의 형식입니다.
System.IO.FileInfo
The FileInfo object contains the information about the certificate file.
예
EXAMPLE 1
This example exports a certificate to the file system as a Microsoft serialized certificate store without its private key.
PS C:\> $cert = (Get-ChildItem -Path cert:\CurrentUser\My\EEDEF61D4FF6EDBAAD538BB08CCAADDC3EE28FF)
PS C:\> Export-Certificate -Cert $cert -FilePath c:\certs\user.sst -Type SST
EXAMPLE 2
This example exports a certificate to the file system as a DER-encoded .cer
file without its private key.
PS C:\> $cert = (Get-ChildItem -Path cert:\CurrentUser\My\EEDEF61D4FF6EDBAAD538BB08CCAADDC3EE28FF)
PS C:\> Export-Certificate -Cert $cert -FilePath c:\certs\user.cer
EXAMPLE 3
This example exports a certificate to the file system as a PKCS#7-fomatted .p7b file without its private key.
PS C:\> $cert = ( Get-ChildItem -Path cert:\CurrentUser\My\EEDEF61D4FF6EDBAAD538BB08CCAADDC3EE28FF )
PS C:\> Export-Certificate -Cert $cert -FilePath c:\certs\user.p7b -Type p7b
EXAMPLE 4
This example exports all certificates under CurrentUser\my store into a Microsoft serialized certificate store allcerts.sst.
PS C:\> Get-ChildItem -Path cert:\CurrentUser\my | Export-Certificate –FilePath c:\certs\allcerts.sst -Type SST