Import-QADCertificate

From PowerGUI Wiki

Jump to: navigation, search

Create a certificate object and populate the object with the X.509 certificate data from a byte array or a file.

This cmdlet is part of the Quest ActiveRoles Server product. Use Get-QARSProductInfo to view information about ActiveRoles Server.

Contents

Syntax

Import-QADCertificate -File <FileInfo> [-ImportFlags {DefaultKeySet | UserKeySet | MachineKeySet | Exportable | UserProtected | PersistKeySet}] [-Password <SecureString>] [<CommonParameters>]

Import-QADCertificate [-FileName] <string> [-ImportFlags {DefaultKeySet | UserKeySet | MachineKeySet | Exportable | UserProtected | PersistKeySet}] [-Password <SecureString>] [<CommonParameters>]

Import-QADCertificate -RawData <object> [-ImportFlags {DefaultKeySet | UserKeySet | MachineKeySet | Exportable | UserProtected | PersistKeySet}] [-Password <SecureString>] [<CommonParameters>]

Detailed Description

Use this cmdlet to create a certificate object populated with the X.509 certificate data found in a byte array or a file. The cmdlet can take an output object of the Get-Content cmdlet containing the data found in a certificate file, and return a certificate object that represents the corresponding certificate. Another option is to have the cmdlet import the certificate data directly from a certificate file specified (see examples).



Parameters

Name Description Required? Pipeline Input Default Value
File This parameter is intended to receive a FileInfo object that identifies the file containing the X.509 certificate data to import. If you need to supply the path and name of the file, use the FileName parameter.

With this parameter, the cmdlet takes a certificate file that represents an X.509 certificate, and populates the output object with the certificate the file contains. The cmdlet supports all the certificate file types that could be created by Export-QADCertificate, including DER- or Base64-encoded X.509 certificate files (.CER), PKCS7 (.P7B) and PKCS12 (.PFX) certificate files, and Microsoft serialized certificate store (.SST) files.

true true (ByValue)
FileName Use this parameter to supply the path and name of the file containing the X.509 certificate data to import. The path can be an absolute path, such as C:\MyCertificates\Cert.cer, or a relative path. If the path or file name includes spaces, enclose the parameter value in quotation marks.

With this parameter, the cmdlet takes a certificate file that represents an X.509 certificate, and populates the output object with the certificate the file contains. The cmdlet supports all the certificate file types that could be created by Export-QADCertificate, including DER- or Base64-encoded X.509 certificate files (.CER), PKCS7 (.P7B) and PKCS12 (.PFX) certificate files, and Microsoft serialized certificate store (.SST) files.

true false
ImportFlags Use this parameter to specify where and how to import the private key associated with the certificate. Parameter value can be a member of the X509KeyStorageFlags enumeration, such as UserKeySet, MachineKeySet, Exportable or UserProtected. For a complete list of the enumeration members, see the "X509KeyStorageFlags Enumeration" article in Microsoft's .NET Framework Class Library at msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509keystorageflags.aspx

The following values are permitted for this object type.

false false
Password Use this parameter to specify the password required to access the X.509 certificate data. false false
RawData Use this parameter to specify the object that contains the X.509 certificate data to import. This could be, for example, an output object of the Get-Content cmdlet. true true (ByPropertyName)

Input Type

object[]

Return Values

Quest.ActiveRoles.ArsPowerShellSnapIn.X509CertificateUI

Examples

EXAMPLE 1

Import-QADCertificate c:\cert.cer

Description


Create a certificate object that represents a certificate found in the specified X.509 certificate file (c:\cert.cer).

EXAMPLE 2

dir c:\cert |	
 Import-QADCertificate

Description


Create a set of certificate objects each of which represents one of the certificates found in the X.509 certificate files that are located in the specified folder (c:\cert).

EXAMPLE 3

Import-QADCertificate c:\cert.pfx -Password (ConvertTo-SecureString 'P@ssw0rd' -asplaintext -force)

Description


Create a certificate object that represents a certificate found in the specified password-protected certificate file (c:\cert.pfx) containing the certificate's private key data.

EXAMPLE 4

Import-QADCertificate c:\cert.pfx -Password (ConvertTo-SecureString 'P@ssw0rd' -asplaintext -force) -ImportFlags UserProtected,Exportable

Description


Create a certificate object that represents a certificate found in the specified password-protected certificate file (c:\cert.pfx) containing the certificate's private key data, and configure the certificate in the certificate object to enable strong protection for the private key and mark the private key as exportable.

Personal tools