Skip to content

Commit

Permalink
Release/2.2.0 (VC-K 5.0.0) (#8)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Christian Kollmann <[email protected]>
  • Loading branch information
JesusMcCloud and nodh authored Oct 2, 2024
1 parent 80fe272 commit c00d128
Show file tree
Hide file tree
Showing 12 changed files with 232 additions and 131 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ out/

### VS Code ###
.vscode/
.kotlin/
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Powered by VC-K](https://img.shields.io/badge/VC--K-powered-8A2BE2?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4LjAzIDkuNSI+PGcgZmlsbD0iIzhhMmJlMiIgZm9udC1mYW1pbHk9IlZBTE9SQU5UIiBmb250LXNpemU9IjEyLjciIHRleHQtYW5jaG9yPSJtaWRkbGUiPjxwYXRoIGQ9Ik01OS42NCAyMjIuMTNxMC0uOTguMzYtMS44Mi4zNy0uODQuOTgtMS40Ni42Mi0uNjIgMS40Ni0uOTYuODMtLjM2IDEuOC0uMzUgMS4wMy4wMiAxLjkuNDIuODcuNCAxLjUgMS4xMi4wNC4wNS4wMy4xMSAwIC4wNy0uMDUuMWwtMSAuODZxLS4wNi4wMy0uMTIuMDN0LS4xLS4wNnEtLjQyLS40OC0xLS43Ni0uNTYtLjMtMS4yMi0uMjgtLjYuMDEtMS4xMy4yNy0uNTQuMjQtLjkzLjY3LS40LjQyLS42Mi45OC0uMjMuNTYtLjIzIDEuMiAwIC42My4yNCAxLjE4LjI0LjU2LjY1Ljk4LjQuNDIuOTQuNjYuNTMuMjMgMS4xNC4yMy42My0uMDEgMS4yLS4zLjU1LS4yNy45Ni0uNzUuMDQtLjA1LjEtLjA1LjA2LS4wMi4xMS4wM2wxIC44NnEuMDYuMDMuMDYuMS4wMS4wNi0uMDMuMTEtLjY0LjczLTEuNTMgMS4xNC0uOS40MS0xLjk1LjQtLjk1IDAtMS43OS0uMzYtLjgyLS4zNy0xLjQzLS45OS0uNjEtLjYzLS45NS0xLjQ4LS4zNS0uODUtLjM1LTEuODN6IiBzdHlsZT0iLWlua3NjYXBlLWZvbnQtc3BlY2lmaWNhdGlvbjpWQUxPUkFOVDt0ZXh0LWFsaWduOmNlbnRlciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTU5LjY0IC0yMTcuNDIpIi8+PHBhdGggZD0iTTY2LjIxIDIyMS4zNWgxLjNjLjEgMCAuMTYuMDYuMTYuMTd2MS4zOGMwIC4xMS0uMDUuMTctLjE2LjE3aC0xLjNjLS4xIDAtLjE2LS4wNi0uMTYtLjE3di0xLjM4YzAtLjExLjA1LS4xNy4xNi0uMTd6IiBsZXR0ZXItc3BhY2luZz0iLTMuMTIiIHN0eWxlPSItaW5rc2NhcGUtZm9udC1zcGVjaWZpY2F0aW9uOlZBTE9SQU5UO3RleHQtYWxpZ246Y2VudGVyIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtNTkuNjQgLTIxNy40MikiLz48L2c+PC9zdmc+&logoColor=white&labelColor=white)](https://github.com/a-sit-plus/vck)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-brightgreen.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
[![Kotlin](https://img.shields.io/badge/kotlin-multiplatform--mobile-orange.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-2.0.0-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-2.0.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
![Java](https://img.shields.io/badge/java-17-blue.svg?logo=OPENJDK)
[![Maven Central](https://img.shields.io/maven-central/v/at.asitplus.wallet/eupidcredential)](https://mvnrepository.com/artifact/at.asitplus.wallet/eupidcredential/)

Expand Down Expand Up @@ -43,6 +43,9 @@ See [PID Rule Book](https://github.com/eu-digital-identity-wallet/eudi-doc-archi

## Changelog

Release 2.2.0
- Update to VC-K 5.0.0

Release 2.1.3:
- Update to VC-K 4.1.0

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("at.asitplus.gradle.conventions") version "2.0.0+20240725"
id("at.asitplus.gradle.conventions") version "2.0.20+20240920"
}

val artifactVersion: String by extra
Expand Down
9 changes: 1 addition & 8 deletions eupidcredential/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,12 @@ kotlin {
commonMain {
dependencies {
api(serialization("json"))
api("at.asitplus.wallet:vck:4.1.0")
api("at.asitplus.wallet:vck:5.0.0")
}
}
}
}

repositories{
mavenCentral()
maven(url = uri("https://s01.oss.sonatype.org/content/repositories/releases/"))
maven(url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}


val javadocJar = setupDokka(baseUrl = "https://github.com/a-sit-plus/eu-pid-credential/tree/main/")

//catch the missing `signMavenPublication` Task, which slips through for reasons unknown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,142 +18,99 @@ data class EuPidCredential(

override val id: String,

/**
* Current last name(s) or surname(s) of the PID User.
*/
/** Current last name(s) or surname(s) of the PID User. */
@SerialName(Attributes.FAMILY_NAME)
val familyName: String,

/**
* Current first name(s), including middle name(s), of the PID User.
*/
/** Current first name(s), including middle name(s), of the PID User. */
@SerialName(Attributes.GIVEN_NAME)
val givenName: String,

/**
* Day, month, and year on which the PID User was born.
*/
/** Day, month, and year on which the PID User was born. */
@SerialName(Attributes.BIRTH_DATE)
@Serializable(with = LocalDateIso8601Serializer::class)
val birthDate: LocalDate,

/**
* Attesting whether the PID User is currently an adult (true) or a minor (false).
*/
/** Attesting whether the PID User is currently an adult (true) or a minor (false). */
@SerialName(Attributes.AGE_OVER_18)
val ageOver18: Boolean? = null,

/**
* The current age of the PID User in years.
*/
/** The current age of the PID User in years. */
@SerialName(Attributes.AGE_IN_YEARS)
val ageInYears: UInt? = null,

/**
* The year when the PID User was born.
*/
/** The year when the PID User was born. */
@SerialName(Attributes.AGE_BIRTH_YEAR)
val ageBirthYear: UInt? = null,

/**
* Last name(s) or surname(s) of the PID User at the time of birth.
*/
/** Last name(s) or surname(s) of the PID User at the time of birth. */
@SerialName(Attributes.FAMILY_NAME_BIRTH)
val familyNameBirth: String? = null,

/**
* First name(s), including middle name(s), of the PID User at the time of birth.
*/
/** First name(s), including middle name(s), of the PID User at the time of birth. */
@SerialName(Attributes.GIVEN_NAME_BIRTH)
val givenNameBirth: String? = null,

/**
* The country, state, and city where the PID User was born.
*/
/** The country, state, and city where the PID User was born. */
@SerialName(Attributes.BIRTH_PLACE)
val birthPlace: String? = null,

/**
* The country where the PID User was born, as an Alpha-2 country code as specified in ISO 3166-1.
*/
/** The country where the PID User was born, as an Alpha-2 country code as specified in ISO 3166-1. */
@SerialName(Attributes.BIRTH_COUNTRY)
val birthCountry: String? = null,

/**
* The state, province, district, or local area where the PID User was born.
*/
/** The state, province, district, or local area where the PID User was born. */
@SerialName(Attributes.BIRTH_STATE)
val birthState: String? = null,

/**
* The municipality, city, town, or village where the PID User was born.
*/
/** The municipality, city, town, or village where the PID User was born. */
@SerialName(Attributes.BIRTH_CITY)
val birthCity: String? = null,

/**
* The full address of the place where the PID User currently resides and/or can be contacted (street name, house number, city etc.).
* The full address of the place where the PID User currently resides and/or can be contacted
* (street name, house number, city etc.).
*/
@SerialName(Attributes.RESIDENT_ADDRESS)
val residentAddress: String? = null,

/**
* The country where the PID User currently resides, as an Alpha-2 country code as specified in ISO 3166-1.
*/
/** The country where the PID User currently resides, as an Alpha-2 country code as specified in ISO 3166-1. */
@SerialName(Attributes.RESIDENT_COUNTRY)
val residentCountry: String? = null,

/**
* The state, province, district, or local area where the PID User currently resides.
*/
/** The state, province, district, or local area where the PID User currently resides. */
@SerialName(Attributes.RESIDENT_STATE)
val residentState: String? = null,

/**
* The municipality, city, town, or village where the PID User currently resides.
*/
/** The municipality, city, town, or village where the PID User currently resides. */
@SerialName(Attributes.RESIDENT_CITY)
val residentCity: String? = null,

/**
* Postal code of the place where the PID User currently resides.
*/
/** Postal code of the place where the PID User currently resides. */
@SerialName(Attributes.RESIDENT_POSTAL_CODE)
val residentPostalCode: String? = null,

/**
* The name of the street where the PID User currently resides.
*/
/** The name of the street where the PID User currently resides. */
@SerialName(Attributes.RESIDENT_STREET)
val residentStreet: String? = null,

/**
* The house number where the PID User currently resides, including any affix or suffix.
*/
/** The house number where the PID User currently resides, including any affix or suffix. */
@SerialName(Attributes.RESIDENT_HOUSE_NUMBER)
val residentHouseNumber: String? = null,

/**
* PID User’s gender, using a value as defined in ISO/IEC 5218.
*/
/** PID User’s gender, using a value as defined in ISO/IEC 5218. */
@SerialName(Attributes.GENDER)
val gender: IsoIec5218Gender? = null,

/**
* Alpha-2 country code as specified in ISO 3166-1, representing the nationality of the PID User.
*/
/** Alpha-2 country code as specified in ISO 3166-1, representing the nationality of the PID User. */
@SerialName(Attributes.NATIONALITY)
val nationality: String? = null,

/**
* Date (and possibly time) when the PID was issued.
*/
/** Date (and possibly time) when the PID was issued. */
@SerialName(Attributes.ISSUANCE_DATE)
val issuanceDate: Instant,

/**
* Date (and possibly time) when the PID will expire.
*/
/** Date (and possibly time) when the PID will expire. */
@SerialName(Attributes.EXPIRY_DATE)
val expiryDate: Instant,

Expand All @@ -165,28 +122,22 @@ data class EuPidCredential(
@SerialName(Attributes.ISSUING_AUTHORITY)
val issuingAuthority: String,

/**
* A number for the PID, assigned by the PID Provider.
*/
/** A number for the PID, assigned by the PID Provider. */
@SerialName(Attributes.DOCUMENT_NUMBER)
val documentNumber: String? = null,

/**
* A number assigned by the PID Provider for audit control or other purposes.
*/
/** A number assigned by the PID Provider for audit control or other purposes. */
@SerialName(Attributes.ADMINISTRATIVE_NUMBER)
val administrativeNumber: String? = null,

/**
* Alpha-2 country code, as defined in ISO 3166-1, of the PID Provider's country or territory.
*/
/** Alpha-2 country code, as defined in ISO 3166-1, of the PID Provider's country or territory. */
@SerialName(Attributes.ISSUING_COUNTRY)
val issuingCountry: String,

/**
* Country subdivision code of the jurisdiction that issued the PID, as
* defined in ISO 3166-2:2020, Clause 8. The first part of the code SHALL
* be the same as the value for issuing_country.
* be the same as the value for [issuingCountry].
*/
@SerialName(Attributes.ISSUING_JURISDICTION)
val issuingJurisdiction: String? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,76 +64,100 @@ object EuPidScheme : ConstantIndex.CredentialScheme {
)

object Attributes {
/** Current last name(s) or surname(s) of the PID User. */
const val FAMILY_NAME = "family_name"

/** Current first name(s), including middle name(s), of the PID User. */
const val GIVEN_NAME = "given_name"

/** Day, month, and year on which the PID User was born. */
const val BIRTH_DATE = "birth_date"

/** Attesting whether the PID User is currently an adult (true) or a minor (false). */
const val AGE_OVER_18 = "age_over_18"

/** The current age of the PID User in years. */
const val AGE_IN_YEARS = "age_in_years"

/** The year when the PID User was born. */
const val AGE_BIRTH_YEAR = "age_birth_year"

/** Last name(s) or surname(s) of the PID User at the time of birth. */
const val FAMILY_NAME_BIRTH = "family_name_birth"

/** First name(s), including middle name(s), of the PID User at the time of birth. */
const val GIVEN_NAME_BIRTH = "given_name_birth"

/** The country, state, and city where the PID User was born. */
const val BIRTH_PLACE = "birth_place"

/** The country where the PID User was born, as an Alpha-2 country code as specified in ISO 3166-1. */
const val BIRTH_COUNTRY = "birth_country"

/** The state, province, district, or local area where the PID User was born. */
const val BIRTH_STATE = "birth_state"

/** The municipality, city, town, or village where the PID User was born. */
const val BIRTH_CITY = "birth_city"

/**
* The full address of the place where the PID User currently resides and/or can be contacted
* (street name, house number, city etc.).
*/
const val RESIDENT_ADDRESS = "resident_address"

/** The country where the PID User currently resides, as an Alpha-2 country code as specified in ISO 3166-1. */
const val RESIDENT_COUNTRY = "resident_country"

/** The state, province, district, or local area where the PID User currently resides. */
const val RESIDENT_STATE = "resident_state"

/** The municipality, city, town, or village where the PID User currently resides. */
const val RESIDENT_CITY = "resident_city"

/** Postal code of the place where the PID User currently resides. */
const val RESIDENT_POSTAL_CODE = "resident_postal_code"

/** The name of the street where the PID User currently resides. */
const val RESIDENT_STREET = "resident_street"

/** The house number where the PID User currently resides, including any affix or suffix. */
const val RESIDENT_HOUSE_NUMBER = "resident_house_number"

/** PID User’s gender, using a value as defined in ISO/IEC 5218. */
const val GENDER = "gender"

/** Alpha-2 country code as specified in ISO 3166-1, representing the nationality of the PID User. */
const val NATIONALITY = "nationality"

/** Date (and possibly time) when the PID was issued. */
const val ISSUANCE_DATE = "issuance_date"

/** Date (and possibly time) when the PID will expire. */
const val EXPIRY_DATE = "expiry_date"

/**
* Name of the administrative authority that has issued this PID instance, or
* the ISO 3166 Alpha-2 country code of the respective Member State if
* there is no separate authority authorized to issue PIDs.
*/
const val ISSUING_AUTHORITY = "issuing_authority"

/** A number for the PID, assigned by the PID Provider. */
const val DOCUMENT_NUMBER = "document_number"

/** A number assigned by the PID Provider for audit control or other purposes. */
const val ADMINISTRATIVE_NUMBER = "administrative_number"

/** Alpha-2 country code, as defined in ISO 3166-1, of the PID Provider's country or territory. */
const val ISSUING_COUNTRY = "issuing_country"

/**
* Country subdivision code of the jurisdiction that issued the PID, as
* defined in ISO 3166-2:2020, Clause 8. The first part of the code SHALL
* be the same as the value for [ISSUING_COUNTRY].
*/
const val ISSUING_JURISDICTION = "issuing_jurisdiction"
}

/**
* Maps names from [Attributes] to claim names used in SD-JWT
*/
val claimNameMap = mapOf(
Attributes.FAMILY_NAME to Attributes.FAMILY_NAME,
Attributes.GIVEN_NAME to Attributes.GIVEN_NAME,
Attributes.BIRTH_DATE to "birthdate",

Attributes.AGE_OVER_18 to "age_equal_or_over/18",
Attributes.AGE_IN_YEARS to Attributes.AGE_IN_YEARS,
Attributes.AGE_BIRTH_YEAR to Attributes.AGE_BIRTH_YEAR,
Attributes.FAMILY_NAME_BIRTH to "birth_family_name",
Attributes.GIVEN_NAME_BIRTH to "birth_given_name",
Attributes.BIRTH_PLACE to "place_of_birth/locality",
Attributes.BIRTH_COUNTRY to "place_of_birth/country",
Attributes.BIRTH_STATE to "place_of_birth/region",
Attributes.BIRTH_CITY to "place_of_birth/locality",

Attributes.RESIDENT_ADDRESS to "address/formatted",
Attributes.RESIDENT_COUNTRY to "address/country",
Attributes.RESIDENT_STATE to "address/region",
Attributes.RESIDENT_CITY to "address/locality",
Attributes.RESIDENT_POSTAL_CODE to "address/postal_code",
Attributes.RESIDENT_STREET to "address/street_address",
Attributes.RESIDENT_HOUSE_NUMBER to "address/house_number",

Attributes.GENDER to Attributes.GENDER,
Attributes.NATIONALITY to "nationalities",

Attributes.ISSUANCE_DATE to "iat",
Attributes.EXPIRY_DATE to "exp",
Attributes.ISSUING_AUTHORITY to Attributes.ISSUING_AUTHORITY,
Attributes.DOCUMENT_NUMBER to Attributes.DOCUMENT_NUMBER,
Attributes.ADMINISTRATIVE_NUMBER to Attributes.ADMINISTRATIVE_NUMBER,
Attributes.ISSUING_COUNTRY to Attributes.ISSUING_COUNTRY,
Attributes.ISSUING_JURISDICTION to Attributes.ISSUING_JURISDICTION,
)
}
Loading

0 comments on commit c00d128

Please sign in to comment.