You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Name

Invoke-JS7Decrypt

SYNOPSIS

Encrypts a value or file using an X.509 Certificate or Public Key

SYNTAX

Invoke-JS7Decrypt [-Value] <String> [[-File] <String>] [[-OutFile] <String>] [[-Key] <X509Certificate2>] [[-KeyPath] <String>] [[-KeyPassword] <PSCredential>] [[-JavaHome] <String>] [-JavaLib] <String> [[-JavaOptions] <String>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The cmdlet encrypts strings, numbers and files using asymmetric encryption,
for details see https://kb.sos-berlin.com/display/JS7/JS7+-+Encryption+and+Decryption

PARAMETERS

Value

-Value <String>
Specifies the value that should be encrypted.

Only one of the parameters -Value or -File can be used.

Required?true
Position?1
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

File

-File <String>
Specifies the location of a input file that should be encrypted.

Only one of the parameters -Value or -File can be used.

Required?false
Position?2
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

OutFile

-OutFile <String>
Specifies the location of the encrypted output file that should be created if the -File parameter is used.

If the output file exists, then it will be overwritten.

Required?false
Position?3
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

Key

-Key <X509Certificate2>

Required?false
Position?4
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

KeyPath

-KeyPath <String>

Required?false
Position?5
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

KeyPassword

-KeyPassword <PSCredential>

Required?false
Position?6
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

JavaHome

-JavaHome <String>
Specifies the location to which Java is installed. Java is required to encrypt values or files.
If the parameter is not specified then Java will be used from the value of the JAVA_HOME or PATH environment variables.

Required?false
Position?7
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

JavaLib

-JavaLib <String>
Specifies the location of the JS7 encryption libraries.

The libraries ship with Agents and are available from the Agent's <agent-home>/lib directory. For encryption outside of JS7 products the JS7 encryption libraries are available for download.

Required?true
Position?8
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

JavaOptions

-JavaOptions <String>
Specifies the Java options used when invoking Java for encryption using the -EncryptCertificatePath or -EncryptCertificate parameters.
Java options can be used for example to limit memory usage as with -JavaOptions "-Xmx32m".

Required?false
Position?9
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

WhatIf

-WhatIf <SwitchParameter>

Required?false
Position?named
Default value
Accept pipeline input?false
Accept wildcard characters?false

Confirm

-Confirm <SwitchParameter>

Required?false
Position?named
Default value
Accept pipeline input?false
Accept wildcard characters?false

about_JS7

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

PS > Invoke-JS7Decrypt -Value $result -KeyPath C:\js7\js7.encryption\agent.key -KeyPassword (New-Object -typename System.Management.Automation.PSCredential -ArgumentList 'key', ( 'jobscheduler' | ConvertTo-SecureString -AsPlainText -Force)) -JavaLib C:\js7\js7.encryption\lib

Returns the decrypted value of the encryption result result. The -KeyPath argument specifies the location of the Private Key file. The -JavaLib argument specifies the location of the JS7 encryption libraries.

-------------------------- EXAMPLE 2 --------------------------

PS > Invoke-JS7Decrypt -Value $result -File /tmp/secret.txt.enc -OutFile /tmp/secret.txt.dec -KeyPath C:\js7\js7.encryption\agent.key -KeyPassword (New-Object -typename System.Management.Automation.PSCredential -ArgumentList 'key', ( 'jobscheduler' | ConvertTo-SecureString -AsPlainText -Force)) -JavaLib C:\js7\js7.encryption\lib

Returns the encryption result. The -KeyPath argument specifies the location of the Private Key file. The -JavaLib argument specifies the location of the JS7 encryption libraries.

  • No labels