Invoke-​Service​Fabric​Decrypt​Text

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

1:

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

Required Parameters

-CipherText

Specifies the cipher text for the cmdlet.

Type:String
Position:1
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.