# SigningInfoCompat

Artifact: [androidx.credentials:credentials](https://developer.android.com/jetpack/androidx/releases/credentials) [View Source](https://cs.android.com/search?q=file:androidx/credentials/provider/SigningInfoCompat.kt+class:androidx.credentials.provider.SigningInfoCompat) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.5.0)

*** ** * ** ***


```
public final class SigningInfoCompat
```

<br />

*** ** * ** ***

Signing information for an app package.

Backward compatible representation of a `https://developer.android.com/reference/android/content/pm/SigningInfo.html`. On Android 27 and below where `https://developer.android.com/reference/android/content/pm/SigningInfo.html` isn't available, this will be initialized from the app's `https://developer.android.com/reference/android/content/pm/PackageInfo.html#signatures`, in which case only signingCertificateHistory will be set.

## Summary

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat` | `@https://developer.android.com/reference/androidx/annotation/DeprecatedSinceApi(api = 28, message = "Use SigningInfoCompat.fromSigningInfo(SigningInfo) instead") https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat#fromSignatures(kotlin.collections.List)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/pm/Signature.html> signatures)` Creates a `https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat` from a list of `https://developer.android.com/reference/android/content/pm/Signature.html`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 28) https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat#fromSigningInfo(android.content.pm.SigningInfo)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/pm/SigningInfo.html signingInfo)` Creates a `https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat` from `https://developer.android.com/reference/android/content/pm/SigningInfo.html`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/pm/Signature.html>` | `https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat#getApkContentsSigners()()` for API 28 and above, this is the same as the app's `https://developer.android.com/reference/android/content/pm/SigningInfo.html#getApkContentsSigners()`; for before API 35, this is empty |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/security/PublicKey.html>` | `https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat#getPublicKeys()()` for API 35 and above, this is the same as the app's `https://developer.android.com/reference/android/content/pm/SigningInfo.html#getPublicKeys()`; for before API 28, this is empty |
| `final int` | `https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat#getSchemeVersion()()` for API 35 and above, this is the same as the app's `https://developer.android.com/reference/android/content/pm/SigningInfo.html#getSchemeVersion()`; for before API 35, this is 0 (unknown) |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/pm/Signature.html>` | `https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat#getSigningCertificateHistory()()` for API 28 and above, this is the same as the app's `https://developer.android.com/reference/android/content/pm/SigningInfo.html#getSigningCertificateHistory()`; for before API 28, this is the list of `https://developer.android.com/reference/android/content/pm/Signature.html`s of the app initialized from the app's `https://developer.android.com/reference/android/content/pm/PackageInfo.html#signatures` |
| `final boolean` | `https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat#hasMultipleSigners()()` for API 28 and above, this is the same as the app's `https://developer.android.com/reference/android/content/pm/SigningInfo.html#hasMultipleSigners()`; for before API 28, this is false |
| `final boolean` | `https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat#hasPastSigningCertificates()()` for API 28 and above, this is the same as the app's `https://developer.android.com/reference/android/content/pm/SigningInfo.html#hasPastSigningCertificates()`; for before API 28, this is false |
| `int` | `https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat#hashCode()()` |

## Public methods

### equals

```
public boolean equals(Object other)
```

### fromSignatures

```
@DeprecatedSinceApi(api = 28, message = "Use SigningInfoCompat.fromSigningInfo(SigningInfo) instead")
public static final @NonNull SigningInfoCompat fromSignatures(@NonNull List<@NonNull Signature> signatures)
```

Creates a `https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat` from a list of `https://developer.android.com/reference/android/content/pm/Signature.html`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/pm/Signature.html> signatures` | the app signatures, which should be retrieved from the app's `https://developer.android.com/reference/android/content/pm/PackageInfo.html#signatures` |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If this is invoked on \>= API 28 |

### fromSigningInfo

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.5.0)

```
@RequiresApi(value = 28)
public static final @NonNull SigningInfoCompat fromSigningInfo(@NonNull SigningInfo signingInfo)
```

Creates a `https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat` from `https://developer.android.com/reference/android/content/pm/SigningInfo.html`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/pm/SigningInfo.html signingInfo` | the signing information of an app package |

### getApkContentsSigners

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.5.0)

```
public final @NonNull List<@NonNull Signature> getApkContentsSigners()
```

for API 28 and above, this is the same as the app's `https://developer.android.com/reference/android/content/pm/SigningInfo.html#getApkContentsSigners()`; for before API 35, this is empty

### getPublicKeys

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.5.0)

```
public final @NonNull Collection<@NonNull PublicKey> getPublicKeys()
```

for API 35 and above, this is the same as the app's `https://developer.android.com/reference/android/content/pm/SigningInfo.html#getPublicKeys()`; for before API 28, this is empty

### getSchemeVersion

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.5.0)

```
public final int getSchemeVersion()
```

for API 35 and above, this is the same as the app's `https://developer.android.com/reference/android/content/pm/SigningInfo.html#getSchemeVersion()`; for before API 35, this is 0 (unknown)

### getSigningCertificateHistory

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.5.0)

```
public final @NonNull List<@NonNull Signature> getSigningCertificateHistory()
```

for API 28 and above, this is the same as the app's `https://developer.android.com/reference/android/content/pm/SigningInfo.html#getSigningCertificateHistory()`; for before API 28, this is the list of `https://developer.android.com/reference/android/content/pm/Signature.html`s of the app initialized from the app's `https://developer.android.com/reference/android/content/pm/PackageInfo.html#signatures`

### hasMultipleSigners

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.5.0)

```
public final boolean hasMultipleSigners()
```

for API 28 and above, this is the same as the app's `https://developer.android.com/reference/android/content/pm/SigningInfo.html#hasMultipleSigners()`; for before API 28, this is false

### hasPastSigningCertificates

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/credentials#1.5.0)

```
public final boolean hasPastSigningCertificates()
```

for API 28 and above, this is the same as the app's `https://developer.android.com/reference/android/content/pm/SigningInfo.html#hasPastSigningCertificates()`; for before API 28, this is false

### hashCode

```
public int hashCode()
```