Invoke-ServiceFabricEncryptText

Encrypts text to include in Service Fabric manifests or configurations.

Syntax

Invoke-ServiceFabricEncryptText
      [-Text] <String>
      [-AlgorithmOid <String>]
      [-CertStore]
      -CertThumbprint <String>
      [-StoreName <String>]
      [-StoreLocation <StoreLocation>]
      [-TimeoutSec <Int32>]
      [<CommonParameters>]
Invoke-ServiceFabricEncryptText
      [-Text] <String>
      [-AlgorithmOid <String>]
      [-CertFile]
      -Path <String>
      [-TimeoutSec <Int32>]
      [<CommonParameters>]

Description

The Invoke-ServiceFabricEncryptText cmdlet encrypts text to include in the Service Fabric cluster manifest, application manifest, or application configurations.

Note

The certificate used for encrypting text must have Data Encipherment as one of the Key Usage fields.

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

Examples

Example 1: Encrypt text with a Service Fabric manifest

$thumbprint="bf 7c 7a 9f 02 6c 60 62 c6 df 65 55 98 b7 44 e3 99 46 f7 27"
$encryptedText = Invoke-ServiceFabricEncryptText -Text "hello world" -CertThumbprint $thumbprint -CertStore -StoreLocation LocalMachine -StoreName My

Example 2:

$encryptedText = Invoke-ServiceFabricEncryptText -Text "hello world" -CertFile -Path c:\temp\mycert.cer

Parameters

-AlgorithmOid

Specifies the object identifier of the algorithm for this cmdlet.

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

-CertFile

Indicates that this cmdlet uses the CertFile option.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-CertStore

Indicates that this cmdlet uses the CertStore option.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-CertThumbprint

Specifies the thumbprint of a certificate.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Path

Specifies a path of a .cert or .pfx file.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-StoreLocation

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

  • CurrentUser
  • LocalMachine
Type:StoreLocation
Accepted values:CurrentUser, LocalMachine
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StoreName

Specifies the name of a certificate store.

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

-Text

Specifies the text for the cmdlet.

Type:String
Position:0
Default value:None
Required:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

System.Object