Invoke-ServiceFabricEncryptText
加密要包含在 Service Fabric 資訊清單或組態中的文字。
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
Invoke-ServiceFabricEncryptText Cmdlet 會加密要包含在 Service Fabric 叢集資訊清單、應用程式資訊清單或應用程式組態中的文字。
注意
用於加密文字的憑證必須具有 [資料加密] 作為其中一個 [金鑰使用方式] 欄位。
在 Service Fabric 叢集上執行任何作業之前,請先使用 Connect-ServiceFabricCluster Cmdlet 建立叢集的連線。
範例
範例 1:使用 Service Fabric 資訊清單加密文字
$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
範例 2:
$encryptedText = Invoke-ServiceFabricEncryptText -Text "hello world" -CertFile -Path c:\temp\mycert.cer
參數
-AlgorithmOid
指定這個 Cmdlet 之演算法的物件識別碼。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CertFile
表示此 Cmdlet 使用 CertFile 選項。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CertStore
表示此 Cmdlet 使用 CertStore 選項。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CertThumbprint
指定憑證的指紋。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Path
指定 .cert 或 .pfx 檔案的路徑。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StoreLocation
指定憑證存放區的位置。 有效值為:
- CurrentUser
- LocalMachine
Type: | StoreLocation |
Accepted values: | CurrentUser, LocalMachine |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StoreName
指定憑證存放區的名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Text
指定 Cmdlet 的文字。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TimeoutSec
指定作業的逾時期間,以秒為單位。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸入
None
輸出
System.Object