en-US/CATEncryptor.dll-Help.xml
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Protect-File</command:name> <command:verb>Protect</command:verb> <command:noun>File</command:noun> <maml:description> <maml:para>Encrypts a given file using an installed certificate chosen by the user.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Uses RSA encryption and a user-specified certificate to encrypt a file.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Protect-File</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:description> <maml:para>The path to the unencrypted file that is to be encrypted.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>OutFile</maml:name> <maml:description> <maml:para>The path to where the encrypted file will be output. If blank, it defaults to the name of the unencrypted file with ".encrypted" appended.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Certificate</maml:name> <maml:description> <maml:para>The X509Certificate2 object (a certificate) that will be used to perform the file encryption.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">X509Certificate2</command:parameterValue> <dev:type> <maml:name>X509Certificate2</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Certificate</maml:name> <maml:description> <maml:para>The X509Certificate2 object (a certificate) that will be used to perform the file encryption.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">X509Certificate2</command:parameterValue> <dev:type> <maml:name>X509Certificate2</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>OutFile</maml:name> <maml:description> <maml:para>The path to where the encrypted file will be output. If blank, it defaults to the name of the unencrypted file with ".encrypted" appended.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:description> <maml:para>The path to the unencrypted file that is to be encrypted.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> $cert = New-SelfSignedCertificate -DnsName $CertName -CertStoreLocation $CertificateStoreLocation -KeyAlgorithm RSA -KeyLength 4096 -KeyExportPolicy Exportable -KeyProtection None -Provider 'Microsoft Enhanced RSA and AES Cryptographic Provider' PS C:\> Protect-File -Path 'C:\Temp\CatFacts.png' -Certificate $cert</dev:code> <dev:remarks> <maml:para>Encrypt the file "C:\Temp\CatFacts.png" with the certificate created and stored in $cert. The encrypted file is created at "C:\Temp\CatFacts.png.encrypted".</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> $cert = Get-Item "Cert:\CurrentUser\My\$thumbprint" PS C:\> Protect-File -Path 'C:\Temp\CatFacts.png' -OutFile 'C:\Temp\cat.enc' -Certificate $cert</dev:code> <dev:remarks> <maml:para>Encrypt the file "C:\Temp\CatFacts.png" with the certificate whose thumbprint is $thumpbrint, and in the CurrentUser personal store, and stored in $cert. The encrypted file is created at "C:\Temp\cat.enc".</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Protect-String</command:name> <command:verb>Protect</command:verb> <command:noun>String</command:noun> <maml:description> <maml:para>Encrypts a given string using an installed certificate chosen by the user.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Uses RSA encryption and a user-specified certificate to encrypt a string, returns it after base64 encoding to prevent issues rendering the encrypted ciphertext in a console.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Protect-String</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Plaintext</maml:name> <maml:description> <maml:para>The plaintext string to be encrypted.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Certificate</maml:name> <maml:description> <maml:para>The X509Certificate2 object (a certificate) that will be used to perform the file encryption.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">X509Certificate2</command:parameterValue> <dev:type> <maml:name>X509Certificate2</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Certificate</maml:name> <maml:description> <maml:para>The X509Certificate2 object (a certificate) that will be used to perform the file encryption.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">X509Certificate2</command:parameterValue> <dev:type> <maml:name>X509Certificate2</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Plaintext</maml:name> <maml:description> <maml:para>The plaintext string to be encrypted.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> $cert = New-SelfSignedCertificate -DnsName $CertName -CertStoreLocation $CertificateStoreLocation -KeyAlgorithm RSA -KeyLength 4096 -KeyExportPolicy Exportable -KeyProtection None -Provider 'Microsoft Enhanced RSA and AES Cryptographic Provider' PS C:\> Protect-String -Plaintext 'hello world' -Certificate $cert</dev:code> <dev:remarks> <maml:para>Encrypt the text "hello world" with the certificate created and stored in $cert. The encrypted text is then base64 encoded before it is returned in order to prevent issues rendering odd characters in a console.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Unprotect-File</command:name> <command:verb>Unprotect</command:verb> <command:noun>File</command:noun> <maml:description> <maml:para>Decrypts a file that was encrypted with Protect-File, using an installed certificate chosen by the user.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Uses RSA encryption and a user-specified certificate to decrypt a file that was encrypted with Protect-File.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Unprotect-File</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:description> <maml:para>The path to the encrypted file to be decrypted.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>OutFile</maml:name> <maml:description> <maml:para>The path to where the decrypted file will be output. If blank, it defaults to the name of the encrypted file with "decrypted_" prepended, and any ".encrypted" extension removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Certificate</maml:name> <maml:description> <maml:para>The X509Certificate2 object (a certificate) that will be used to perform the file decryption.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">X509Certificate2</command:parameterValue> <dev:type> <maml:name>X509Certificate2</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none"> <maml:name>Certificate</maml:name> <maml:description> <maml:para>The X509Certificate2 object (a certificate) that will be used to perform the file decryption.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">X509Certificate2</command:parameterValue> <dev:type> <maml:name>X509Certificate2</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName)" position="1" aliases="none"> <maml:name>OutFile</maml:name> <maml:description> <maml:para>The path to where the decrypted file will be output. If blank, it defaults to the name of the encrypted file with "decrypted_" prepended, and any ".encrypted" extension removed.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>Path</maml:name> <maml:description> <maml:para>The path to the encrypted file to be decrypted.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> $cert = Get-Item "Cert:\CurrentUser\My\$thumbprint" PS C:\> Unprotect-File -Path 'C:\Temp\CatFacts.png.encrypted' -Certificate $cert</dev:code> <dev:remarks> <maml:para>The encrypted file "C:\Temp\CatFacts.png.encrypted" will be decrypted with the certificate it was encrypted with (stored in $cert). The decrypted file will be stored at "C:\Temp\decrypted_CatFacts.png".</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- Example 2 --------------------------</maml:title> <dev:code>PS C:\> $cert = Get-Item "Cert:\CurrentUser\My\$thumbprint" PS C:\> Protect-File -Path 'C:\Temp\CatFacts.png' -OutFile 'C:\Temp\cat.enc' -Certificate $cert</dev:code> <dev:remarks> <maml:para>The encrypted file "C:\Temp\CatFacts.png.encrypted" will be decrypted with the certificate it was encrypted with (stored in $cert). The decrypted file will be stored at "C:\Temp\cat.png".</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Unprotect-String</command:name> <command:verb>Unprotect</command:verb> <command:noun>String</command:noun> <maml:description> <maml:para>Decrypts a string that was encrypted with Protect-String, using an installed certificate chosen by the user.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>Uses RSA encryption and a user-specified certificate to decrypt a file that was encrypted with Protect-File.</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Unprotect-String</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>CiphertextBase64</maml:name> <maml:description> <maml:para>The base64 encoded string which was encrypted with Protect-String to be decrypted.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Certificate</maml:name> <maml:description> <maml:para>The X509Certificate2 object (a certificate) that will be used to perform the file encryption.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">X509Certificate2</command:parameterValue> <dev:type> <maml:name>X509Certificate2</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none"> <maml:name>Certificate</maml:name> <maml:description> <maml:para>The X509Certificate2 object (a certificate) that will be used to perform the file encryption.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">X509Certificate2</command:parameterValue> <dev:type> <maml:name>X509Certificate2</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="0" aliases="none"> <maml:name>CiphertextBase64</maml:name> <maml:description> <maml:para>The base64 encoded string which was encrypted with Protect-String to be decrypted.</maml:para> </maml:description> <command:parameterValue required="true" variableLength="false">String</command:parameterValue> <dev:type> <maml:name>String</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>System.String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>System.Object</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>-------------------------- Example 1 --------------------------</maml:title> <dev:code>PS C:\> $cert = Get-Item "Cert:\CurrentUser\My\$thumbprint" PS C:\> Unprotect-String -CivertextBase64 $encryptedString -Certificate $cert</dev:code> <dev:remarks> <maml:para>The encrypted (and base64 encoded) string stored in $encryptedString (which was encrypted with Protect-String) will be decrypted with the certificate it was encrypted with (stored in $cert) and written to the output stream as plaintext.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks /> </command:command> </helpItems> |