X509Certificate.GetKeyUsage 方法

定义

获取表示扩展位的 KeyUsage 布尔数组(OID = 2)。

[Android.Runtime.Register("getKeyUsage", "()[Z", "GetGetKeyUsageHandler")]
public abstract bool[]? GetKeyUsage ();
[<Android.Runtime.Register("getKeyUsage", "()[Z", "GetGetKeyUsageHandler")>]
abstract member GetKeyUsage : unit -> bool[]

返回

此证书的 KeyUsage 扩展,表示为布尔值的数组。 数组中 KeyUsage 值的顺序与上述 ASN.1 定义中的顺序相同。 该数组将包含上面定义的每个 KeyUsage 的值。 如果证书中编码的 KeyUsage 列表长于上述列表,则不会截断它。 如果此证书不包含 KeyUsage 扩展,则返回 null。

属性

注解

获取一个布尔数组,表示扩展位 KeyUsage (OID = 2.5.29.15)。 密钥使用扩展定义了证书中包含的密钥的用途(例如加密、签名、证书签名)。 ASN.1 的定义如下:

KeyUsage ::= BIT STRING {
                digitalSignature        (0),
                nonRepudiation          (1),
                keyEncipherment         (2),
                dataEncipherment        (3),
                keyAgreement            (4),
                keyCertSign             (5),
                cRLSign                 (6),
                encipherOnly            (7),
                decipherOnly            (8) }

RFC 3280 建议使用时将其标记为关键扩展。

适用于 . 的 java.security.cert.X509Certificate.getKeyUsage()Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于