語言

KeyProtection.Builder.SetBlockModes(String[]) 方法

定義

設定在加密/解密時可使用金鑰的區塊模式集合(例如 GCM、CBC)。

[Android.Runtime.Register("setBlockModes", "([Ljava/lang/String;)Landroid/security/keystore/KeyProtection$Builder;", "", ApiSince=23)]
public Android.Security.Keystore.KeyProtection.Builder SetBlockModes(params string[]? blockModes);
[<Android.Runtime.Register("setBlockModes", "([Ljava/lang/String;)Landroid/security/keystore/KeyProtection$Builder;", "", ApiSince=23)>]
member this.SetBlockModes : string[] -> Android.Security.Keystore.KeyProtection.Builder

參數

blockModes
String[]

價值屬於以下之一:KeyProperties.BLOCK_MODE_ECB;KeyProperties.BLOCK_MODE_CBC;KeyProperties.BLOCK_MODE_CTR;KeyProperties.BLOCK_MODE_GCM

傳回

屬性

備註

設定在加密/解密時可使用金鑰的區塊模式集合(例如 GCM、CBC)。 嘗試將金鑰用於任何其他區塊模式都會被拒絕。

這必須針對對稱加密/解密金鑰指定。

請參考KeyProperties.BLOCK_MODE常數。

Android 參考資料。android.security.keystore.KeyProtection.Builder.setBlockModes

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於