共用方式為


PackageManager.HasSigningCertificate 方法

定義

多載

HasSigningCertificate(Int32, Byte[], CertificateType)

搜尋套件已證明已簽署指定 uid 的簽署憑證集。

HasSigningCertificate(String, Byte[], CertificateType)

搜尋已證明已簽署指定套件的簽署憑證集。

HasSigningCertificate(Int32, Byte[], CertificateType)

搜尋套件已證明已簽署指定 uid 的簽署憑證集。

[Android.Runtime.Register("hasSigningCertificate", "(I[BI)Z", "GetHasSigningCertificate_IarrayBIHandler", ApiSince=28)]
public virtual bool HasSigningCertificate(int uid, byte[] certificate, Android.Content.PM.CertificateType type);
[<Android.Runtime.Register("hasSigningCertificate", "(I[BI)Z", "GetHasSigningCertificate_IarrayBIHandler", ApiSince=28)>]
abstract member HasSigningCertificate : int * byte[] * Android.Content.PM.CertificateType -> bool
override this.HasSigningCertificate : int * byte[] * Android.Content.PM.CertificateType -> bool

參數

uid
Int32

要檢查其簽署憑證的 uid

certificate
Byte[]

要搜尋的簽署憑證

type
CertificateType

的表示法 certificate

傳回

如果此套件是或是由憑證完全簽署,則為 true certificate

屬性

備註

搜尋套件已證明已簽署指定 uid 的簽署憑證集。 對於共用相同 uid 的多個套件,這會傳回在「最新」套件的簽署歷程記錄中找到的簽署憑證,其中「最新」表示在共用 uid 群組中具有最新簽署憑證的套件。 這個方法應該使用 而非 getPackageInfoGET_SIGNATURES 因為它會考慮簽署憑證輪替的可能性,但多個憑證所簽署的套件除外,因此不支援簽署憑證輪替。 這個方法類似於搭配 使用 getPackagesForUid ,然後getPackageInfoGET_SIGNING_CERTIFICATES選取PackageInfo最新簽署 bpackage 的 ,最後搜尋結果signingInfo欄位,以查看所需的憑證是否存在。

android.content.pm.PackageManager.hasSigningCertificate(int, byte[], int)Java 檔。

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

適用於

HasSigningCertificate(String, Byte[], CertificateType)

搜尋已證明已簽署指定套件的簽署憑證集。

[Android.Runtime.Register("hasSigningCertificate", "(Ljava/lang/String;[BI)Z", "GetHasSigningCertificate_Ljava_lang_String_arrayBIHandler", ApiSince=28)]
public virtual bool HasSigningCertificate(string packageName, byte[] certificate, Android.Content.PM.CertificateType type);
[<Android.Runtime.Register("hasSigningCertificate", "(Ljava/lang/String;[BI)Z", "GetHasSigningCertificate_Ljava_lang_String_arrayBIHandler", ApiSince=28)>]
abstract member HasSigningCertificate : string * byte[] * Android.Content.PM.CertificateType -> bool
override this.HasSigningCertificate : string * byte[] * Android.Content.PM.CertificateType -> bool

參數

packageName
String

要檢查其簽署憑證的套件

certificate
Byte[]

要搜尋的簽署憑證

type
CertificateType

的表示法 certificate

傳回

如果此套件是或是由憑證完全簽署,則為 true certificate

屬性

備註

搜尋已證明已簽署指定套件的簽署憑證集。 這應該使用 ,而不是 getPackageInfo 搭配 GET_SIGNATURES 使用,因為它考慮到簽署憑證輪替的可能性,但在多個憑證簽署的套件的情況下,不支援簽署憑證輪替。 這個方法類似於搭配 使用 getPackageInfo GET_SIGNING_CERTIFICATES ,然後搜尋產生的 signingInfo 欄位,以查看所需的憑證是否存在。

android.content.pm.PackageManager.hasSigningCertificate(java.lang.String, byte[], int)Java 檔。

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

適用於