-
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.
Support for keyless sd-jwt credential provisioning.
Signed-off-by: Peter Sorotokin <[email protected]>
- Loading branch information
Showing
24 changed files
with
487 additions
and
175 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
...rc/commonMain/kotlin/com/android/identity/documenttype/knowntypes/UtopiaNaturalization.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,60 @@ | ||
package com.android.identity.documenttype.knowntypes | ||
|
||
import com.android.identity.cbor.toDataItem | ||
import com.android.identity.cbor.toDataItemFullDate | ||
import com.android.identity.documenttype.DocumentAttributeType | ||
import com.android.identity.documenttype.DocumentType | ||
import com.android.identity.documenttype.Icon | ||
|
||
/** | ||
* Naturalization Certificate of the fictional State of Utopia. | ||
*/ | ||
object UtopiaNaturalization { | ||
const val VCT = "http://utopia.example.com/vct/naturalization" | ||
|
||
/** | ||
* Build the Utopia Naturalization Certificate Document Type. | ||
*/ | ||
fun getDocumentType(): DocumentType { | ||
return DocumentType.Builder("Utopia Naturalization Certificate") | ||
.addVcDocumentType(VCT) | ||
.addVcAttribute( | ||
DocumentAttributeType.String, | ||
"family_name", | ||
"Family Name", | ||
"Current last name(s), surname(s), or primary identifier of the naturalized person", | ||
Icon.PERSON, | ||
SampleData.FAMILY_NAME.toDataItem() | ||
) | ||
.addVcAttribute( | ||
DocumentAttributeType.String, | ||
"given_name", | ||
"Given Names", | ||
"Current first name(s), other name(s), or secondary identifier of the naturalized person", | ||
Icon.PERSON, | ||
SampleData.GIVEN_NAME.toDataItem() | ||
) | ||
.addVcAttribute( | ||
DocumentAttributeType.Date, | ||
"birth_date", | ||
"Date of Birth", | ||
"Day, month, and year on which the naturalized person was born. If unknown, approximate date of birth.", | ||
Icon.TODAY, | ||
SampleData.birthDate.toDataItemFullDate() | ||
) | ||
.addVcAttribute( | ||
DocumentAttributeType.Date, | ||
"naturalization_date", | ||
"Date of Naturalization", | ||
"Date (and possibly time) when the person was naturalized.", | ||
Icon.DATE_RANGE, | ||
SampleData.issueDate.toDataItemFullDate() | ||
) | ||
.addSampleRequest( | ||
id = "full", | ||
displayName = "All Data Elements", | ||
vcClaims = listOf() | ||
) | ||
.build() | ||
} | ||
} |
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
6 changes: 5 additions & 1 deletion
6
...tity-issuance/src/main/java/com/android/identity/issuance/SdJwtVcDocumentConfiguration.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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
package com.android.identity.issuance | ||
|
||
import com.android.identity.cbor.annotation.CborSerializable | ||
import com.android.identity.document.NameSpacedData | ||
|
||
@CborSerializable | ||
data class SdJwtVcDocumentConfiguration( | ||
/** | ||
* The Verifiable Credential Type for SD-JWT VC credentials. | ||
*/ | ||
val vct: String, | ||
/** | ||
* If true or missing, credentials are bound to a key; if present and false credentials | ||
* are keyless. | ||
*/ | ||
val keyBound: Boolean? | ||
) |
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
Oops, something went wrong.