Invoke-ServiceFabricDecryptText

Decrypts the text encrypted by the Invoke-ServiceFabricEncryptText (/.Invoke-ServiceFabricEncryptText.md)cmdlet.

Syntax

Invoke-ServiceFabricDecryptText
      [-CipherText] <String>
      [-StoreLocation <StoreLocation>]
      [-TimeoutSec <Int32>]
      [<CommonParameters>]

Description

The Invoke-ServiceFabricDecryptText cmdlet decrypts text that was encrypted by using the Invoke-ServiceFabricEncryptText cmdlet for verification in Service Fabric.

Before you perform any operation on a Service Fabric cluster, establish a connection to the cluster by using the Connect-ServiceFabricCluster cmdlet.

Note

In order to decrypt the text, the caller of this cmdlet should have access to the private key of the certificate used to encrypt the text.

Examples

Example 1: Decrypt text

PS C:\windows\system32> $EncryptedText = Invoke-ServiceFabricEncryptText -Text "hello world" -CertThumbprint $Thumbprint
-CertStore -StoreLocation LocalMachine -StoreName My

PS C:\windows\system32> Invoke-ServiceFabricDecryptText -CipherText $EncryptedText -StoreLocation "LocalMachine"
hello world

The first command encrypts text using the Invoke-ServiceFabricEncryptText cmdlet and stores the result in the variable named $EncryptedText.

The second command decrypts the text stored in the $EncryptedText variable and saves it to the store location named LocalMachine.

Required Parameters

-CipherText

Specifies the cipher text for the cmdlet.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-StoreLocation

Specifies the location of a certificate store. Valid values are:

  • CurrentUser
  • LocalMachine
Type:StoreLocation
Parameter Sets:CurrentUser, LocalMachine
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TimeoutSec

Specifies the time-out period, in seconds, for the operation.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

This cmdlet accepts a string of cipher text.

Outputs

System.Object

This cmdlet returns decrypted text as a String.