# SigningInfoCompat

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/credentials/provider/SigningInfoCompat "View this page in Java")

<br />

```
class SigningInfoCompat
```

<br />

*** ** * ** ***

Signing information for an app package.

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

## Summary

|                                           ### Public companion functions                                            |
|---------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SigningInfoCompat](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat) | `@`[DeprecatedSinceApi](https://developer.android.com/reference/kotlin/androidx/annotation/DeprecatedSinceApi)`(api = 28, message = "Use SigningInfoCompat.fromSigningInfo(SigningInfo) instead")` [fromSignatures](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat#fromSignatures(kotlin.collections.List))`(signatures: `[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Signature](https://developer.android.com/reference/android/content/pm/Signature.html)`>)` Creates a[SigningInfoCompat](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat)from a list of[Signature](https://developer.android.com/reference/android/content/pm/Signature.html). |
| [SigningInfoCompat](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat) | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 28)` [fromSigningInfo](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat#fromSigningInfo(android.content.pm.SigningInfo))`(signingInfo: `[SigningInfo](https://developer.android.com/reference/android/content/pm/SigningInfo.html)`)` Creates a[SigningInfoCompat](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat)from[SigningInfo](https://developer.android.com/reference/android/content/pm/SigningInfo.html).                                                                                                                                                                          |

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat#hashCode())`()`                                                                                            |

|                                                                                    ### Public properties                                                                                     |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Signature](https://developer.android.com/reference/android/content/pm/Signature.html)`>`        | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 28)` [apkContentsSigners](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat#apkContentsSigners()) for API 28 and above, this is the same as the app's[SigningInfo.getApkContentsSigners](https://developer.android.com/reference/android/content/pm/SigningInfo.html#getApkContentsSigners()); for before API 35, this is empty                                                                                                                                                                   |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                          | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 28)` [hasMultipleSigners](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat#hasMultipleSigners()) for API 28 and above, this is the same as the app's[SigningInfo.hasMultipleSigners](https://developer.android.com/reference/android/content/pm/SigningInfo.html#hasMultipleSigners()); for before API 28, this is false                                                                                                                                                                         |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                          | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 28)` [hasPastSigningCertificates](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat#hasPastSigningCertificates()) for API 28 and above, this is the same as the app's[SigningInfo.hasPastSigningCertificates](https://developer.android.com/reference/android/content/pm/SigningInfo.html#hasPastSigningCertificates()); for before API 28, this is false                                                                                                                                         |
| [Collection](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html)`<`[PublicKey](https://developer.android.com/reference/java/security/PublicKey.html)`>` | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 35)` [publicKeys](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat#publicKeys()) for API 35 and above, this is the same as the app's[SigningInfo.getPublicKeys](https://developer.android.com/reference/android/content/pm/SigningInfo.html#getPublicKeys()); for before API 28, this is empty                                                                                                                                                                                                   |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                  | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 35)` [schemeVersion](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat#schemeVersion()) for API 35 and above, this is the same as the app's[SigningInfo.getSchemeVersion](https://developer.android.com/reference/android/content/pm/SigningInfo.html#getSchemeVersion()); for before API 35, this is 0 (unknown)                                                                                                                                                                                 |
| [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Signature](https://developer.android.com/reference/android/content/pm/Signature.html)`>`        | [signingCertificateHistory](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat#signingCertificateHistory()) for API 28 and above, this is the same as the app's[SigningInfo.getSigningCertificateHistory](https://developer.android.com/reference/android/content/pm/SigningInfo.html#getSigningCertificateHistory()); for before API 28, this is the list of[Signature](https://developer.android.com/reference/android/content/pm/Signature.html)s of the app initialized from the app's[PackageInfo.signatures](https://developer.android.com/reference/android/content/pm/PackageInfo.html#signatures()) |

## Public companion functions

### fromSignatures

```
@DeprecatedSinceApi(api = 28, message = "Use SigningInfoCompat.fromSigningInfo(SigningInfo) instead")
fun fromSignatures(signatures: List<Signature>): SigningInfoCompat
```

Creates a[SigningInfoCompat](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat)from a list of[Signature](https://developer.android.com/reference/android/content/pm/Signature.html).  

|                                                                                             Parameters                                                                                              |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `signatures: `[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Signature](https://developer.android.com/reference/android/content/pm/Signature.html)`>` | the app signatures, which should be retrieved from the app's[PackageInfo.signatures](https://developer.android.com/reference/android/content/pm/PackageInfo.html#signatures()) |

|                                                             Throws                                                             |
|--------------------------------------------------------------------------------------------------------------------------------|----------------------------------|
| [kotlin.IllegalArgumentException](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)
fun fromSigningInfo(signingInfo: SigningInfo): SigningInfoCompat
```

Creates a[SigningInfoCompat](https://developer.android.com/reference/kotlin/androidx/credentials/provider/SigningInfoCompat)from[SigningInfo](https://developer.android.com/reference/android/content/pm/SigningInfo.html).  

|                                                Parameters                                                 |
|-----------------------------------------------------------------------------------------------------------|-------------------------------------------|
| `signingInfo: `[SigningInfo](https://developer.android.com/reference/android/content/pm/SigningInfo.html) | the signing information of an app package |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```  

### hashCode

```
open fun hashCode(): Int
```  

## Public properties

### apkContentsSigners

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

```
@RequiresApi(value = 28)
val apkContentsSigners: List<Signature>
```

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

### hasMultipleSigners

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

```
@RequiresApi(value = 28)
val hasMultipleSigners: Boolean
```

for API 28 and above, this is the same as the app's[SigningInfo.hasMultipleSigners](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)  

```
@RequiresApi(value = 28)
val hasPastSigningCertificates: Boolean
```

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

### publicKeys

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

```
@RequiresApi(value = 35)
val publicKeys: Collection<PublicKey>
```

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

### schemeVersion

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

```
@RequiresApi(value = 35)
val schemeVersion: Int
```

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

### signingCertificateHistory

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

```
val signingCertificateHistory: List<Signature>
```

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