语言

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

定义

设置掩码生成函数 MGF1 可以使用的哈希函数(例如 SHA-256、SHA-384)集(用于键的某些操作)。

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

参数

mgf1Digests
String[]

此值可能为 null。 值为下列值之一:KeyProperties.DIGEST_NONE;KeyProperties.DIGEST_MD5;KeyProperties.DIGEST_SHA1;KeyProperties.DIGEST_SHA224;KeyProperties.DIGEST_SHA256;KeyProperties.DIGEST_SHA384;KeyProperties.DIGEST_SHA512

返回

特性

注解

设置掩码生成函数 MGF1 可以使用的哈希函数(例如 SHA-256、SHA-384)集(用于键的某些操作)。 将拒绝将密钥用于掩码生成函数的任何其他摘要。

这只能为用于 RSA OAEP 填充方案的签名/验证密钥和 RSA 加密/解密密钥指定,因为这些操作涉及包含摘要的掩码生成函数(MGF1)。 MGF1 的默认摘要为 SHA-1,如果未显式提供摘要,则会在密钥导入期间指定该摘要。 使用密钥时,调用方可能不会指定在密钥导入期间未提供的任何摘要。 如果密钥导入期间未显式提供摘要(但不需要这样做),调用方可以指定默认摘要 SHA-1。

请参阅 KeyProperties.DIGEST 常量。

Android 参考。android.security.keystore.KeyProtection.Builder.setMgf1Digests

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于