-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wallet: Add functionality to request identity documents. (#704)
Also add "sample requests" to our repository for well-known doctypes in the identity-doctypes library. Also upgrade to the latest version of https://github.com/yuriy-budiyev/code-scanner Test: Manually tested Test: ./gradlew check Test: ./gradlew connectedCheck Signed-off-by: David Zeuthen <[email protected]>
- Loading branch information
Showing
29 changed files
with
1,684 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
identity/src/commonMain/kotlin/com/android/identity/documenttype/DocumentWellKnownRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.android.identity.documenttype | ||
|
||
|
||
/** | ||
* Class representing a well-known document request. | ||
* | ||
* @param displayName a short string with the name of the request, short enough to be used | ||
* for a button. For example "Age Over 21 and Portrait" or "Full mDL". | ||
*/ | ||
data class DocumentWellKnownRequest( | ||
val displayName: String, | ||
val mdocRequest: MdocRequest?, | ||
) |
12 changes: 12 additions & 0 deletions
12
identity/src/commonMain/kotlin/com/android/identity/documenttype/MdocNamespaceRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.android.identity.documenttype | ||
|
||
/** | ||
* A class representing a request for data elements in a namespace. | ||
* | ||
* @param namespace the namespace. | ||
* @param dataElementsToRequest the data elements to request. | ||
*/ | ||
data class MdocNamespaceRequest( | ||
val namespace: String, | ||
val dataElementsToRequest: List<MdocDataElement> | ||
) |
13 changes: 13 additions & 0 deletions
13
identity/src/commonMain/kotlin/com/android/identity/documenttype/MdocRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.android.identity.documenttype | ||
|
||
/** | ||
* A class representing a request for a particular set of namespaces and data elements | ||
* for a particular document type. | ||
* | ||
* @param docType the mdoc doctype. | ||
* @param namespacesToRequest the namespaces to request. | ||
*/ | ||
data class MdocRequest( | ||
val docType: String, | ||
val namespacesToRequest: List<MdocNamespaceRequest> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
wallet/src/main/java/com/android/identity_credential/wallet/ReaderDataElement.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.android.identity_credential.wallet | ||
|
||
import android.graphics.Bitmap | ||
import com.android.identity.documenttype.MdocDataElement | ||
|
||
data class ReaderDataElement( | ||
// Null if the data element isn't known | ||
val mdocDataElement: MdocDataElement?, | ||
|
||
val value: ByteArray, | ||
|
||
// Only set DocumentAttributeType.Picture | ||
val bitmap: Bitmap?, | ||
) |
14 changes: 14 additions & 0 deletions
14
wallet/src/main/java/com/android/identity_credential/wallet/ReaderDocument.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.android.identity_credential.wallet | ||
|
||
import kotlinx.datetime.Instant | ||
|
||
data class ReaderDocument( | ||
val docType: String, | ||
val msoValidFrom: Instant, | ||
val msoValidUntil: Instant, | ||
val msoSigned: Instant, | ||
val msoExpectedUpdate: Instant?, | ||
val namespaces: List<ReaderNamespace>, | ||
val infoTexts: List<String>, | ||
val warningTexts: List<String>, | ||
) |
Oops, something went wrong.