Skip to content

Commit

Permalink
CredentialTypeRepository with it's content - verified all fields from…
Browse files Browse the repository at this point in the history
… specs
  • Loading branch information
keesgeluk committed Nov 16, 2023
1 parent 2c4ce10 commit 688fa6a
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,42 @@ object NamespaceEUPID : MdocNamespace() {
override val namespace = "eu.europa.ec.eudiw.pid.1"
override val dataElements: List<MdocDataElement> = Element.values().asList()

// TODO: check description/mandatory
enum class Element(
override val type: CredentialAttributeType,
override val identifier: String,
override val displayName: String,
override val description: String,
override val mandatory: Boolean
) : MdocDataElement {
FAMILY_NAME(CredentialAttributeType.STRING,"family_name", "Family Name", "Family Name", true),
FAMILY_NAME_NATIONAL_CHARACTER(CredentialAttributeType.STRING,"family_name_national_characters","Family name in national characters", "Family name in national characters", true),
GIVEN_NAMES(CredentialAttributeType.STRING,"given_name", "Given Names", "Given Names", true),
GIVEN_NAME_NATIONAL_CHARACTER(CredentialAttributeType.STRING,"given_name_national_characters", "Given name in national characters", "Given name in national characters", true),
BIRTH_DATE(CredentialAttributeType.DATE,"birth_date", "Date of birth", "Date of birth", true),
UNIQUE_IDENTIFIER(CredentialAttributeType.STRING,"persistent_id", "Unique Identifier", "Unique Identifier", true),
BIRTH_FAMILY_NAME(CredentialAttributeType.STRING,"family_name_birth", "Family Name at Birth", "Family Name at Birth", true),
BIRTH_FAMILY_NAME_NATIONAL_CHARACTERS(CredentialAttributeType.STRING,"family_name_birth_national_characters", "Family Name at Birth in national characters", "Family Name at Birth in national characters", true),
BIRTH_FIRST_NAME(CredentialAttributeType.STRING,"given_name_birth", "First Name at Birth", "First Name at Birth", true),
BIRTH_FIRST_NAME_NATIONAL_CHARACTERS(CredentialAttributeType.STRING,"given_name_birth_national_characters", "First Name at Birth in national characters", "First Name at Birth in national characters", true),
BIRTH_PLACE(CredentialAttributeType.STRING,"birth_place", "Place of birth", "Place of birth", true),
RESIDENT_ADDRESS(CredentialAttributeType.STRING,"resident_address", "Permanent place of residence", "Permanent place of residence", true),
RESIDENT_POSTAL_CODE(CredentialAttributeType.STRING,"resident_postal_code", "Resident postal code", "Resident postal code", true),
RESIDENT_CITY(CredentialAttributeType.STRING,"resident_city", "Resident city", "Resident city", true),
RESIDENT_STATE(CredentialAttributeType.STRING,"resident_state", "Resident state", "Resident state", true),
RESIDENT_COUNTRY(CredentialAttributeType.STRING,"resident_country", "Resident country", "Resident country", true),
GENDER(CredentialAttributeType.STRING,"gender", "Gender", "Gender", true),
NATIONALITY(CredentialAttributeType.STRING,"nationality", "Nationality", "Nationality", true),
PORTRAIT(CredentialAttributeType.PICTURE,"portrait", "FacialImage/Portrait", "FacialImage/Portrait", true),
PORTRAIT_CAPTURE_DATE(CredentialAttributeType.DATE,"portrait_capture_date", "Portrait image timestamp", "Portrait image timestamp", true),
BIOMETRIC_TEMPLATE_FINGER(CredentialAttributeType.PICTURE,"biometric_template_finger", "Fingerprint", "Fingerprint", true),
AGE_OVER_13(CredentialAttributeType.BOOLEAN,"age_over_13", "Age over 13?", "Age over 13?", true),
AGE_OVER_16(CredentialAttributeType.BOOLEAN,"age_over_16", "Age over 16?", "Age over 16?", true),
AGE_OVER_18(CredentialAttributeType.BOOLEAN,"age_over_18", "Age over 18?", "Age over 18?", true),
AGE_OVER_21(CredentialAttributeType.BOOLEAN,"age_over_21", "Age over 21?", "Age over 21?", true),
AGE_OVER_60(CredentialAttributeType.BOOLEAN,"age_over_60", "Age over 60?", "Age over 60?", true),
AGE_OVER_65(CredentialAttributeType.BOOLEAN,"age_over_65", "Age over 65?", "Age over 65?", true),
AGE_OVER_68(CredentialAttributeType.BOOLEAN,"age_over_68", "Age over 68?", "Age over 68?", true),
AGE_IN_YEARS(CredentialAttributeType.NUMBER,"age_in_years", "How old are you (in years)?", "How old are you (in years)?", true),
AGE_BIRTH_YEAR(CredentialAttributeType.NUMBER,"age_birth_year", "In what year were you born?", "In what year were you born?", true),
FAMILY_NAME(CredentialAttributeType.STRING,"family_name", "Family Name", "Current last name(s), surname(s), or primary identifier of the PID holder", true),
FAMILY_NAME_NATIONAL_CHARACTER(CredentialAttributeType.STRING,"family_name_national_characters","Family name in national characters", "The family name of the PID holder in national (non-Latin) characters", false),
GIVEN_NAMES(CredentialAttributeType.STRING,"given_name", "Given Names", "Current first name(s), other name(s), or secondary identifier of the PID holder", true),
GIVEN_NAME_NATIONAL_CHARACTER(CredentialAttributeType.STRING,"given_name_national_characters", "Given name in national characters", "The given name of the PID holder in national (non-Latin) characters", false),
BIRTH_DATE(CredentialAttributeType.DATE,"birth_date", "Date of birth", "Day, month, and year on which the PID holder was born. If unknown, approximate date of birth.", true),
UNIQUE_IDENTIFIER(CredentialAttributeType.STRING,"persistent_id", "Unique Identifier", "The persistent identifier assigned to the PID holder by the PID provider", true),
BIRTH_FAMILY_NAME(CredentialAttributeType.STRING,"family_name_birth", "Family Name at Birth", "Last name(s), surname(s), or primary identifier of the PID holder at birth", false),
BIRTH_FAMILY_NAME_NATIONAL_CHARACTERS(CredentialAttributeType.STRING,"family_name_birth_national_characters", "Family Name at Birth in national characters", "The family name of the PID holder at birth in national (non-Latin) characters", false),
BIRTH_FIRST_NAME(CredentialAttributeType.STRING,"given_name_birth", "First Name at Birth", "First name(s), other name(s), or secondary identifier of the PID holder at birth", false),
BIRTH_FIRST_NAME_NATIONAL_CHARACTERS(CredentialAttributeType.STRING,"given_name_birth_national_characters", "First Name at Birth in national characters", "The given name of the PID holder at birth in national (non-Latin) characters", false),
BIRTH_PLACE(CredentialAttributeType.STRING,"birth_place", "Place of birth", "Country and municipality or state/province where the PID holder was born", false),
RESIDENT_ADDRESS(CredentialAttributeType.STRING,"resident_address", "Permanent place of residence", "The full address of the place where the PID holder currently resides and/or may be contacted (street/house number, municipality etc.)", false),
RESIDENT_CITY(CredentialAttributeType.STRING,"resident_city", "Resident city", "The city where the PID holder currently resides", false),
RESIDENT_POSTAL_CODE(CredentialAttributeType.STRING,"resident_postal_code", "Resident postal code", "The postal code of the place where the PID holder currently resides", false),
RESIDENT_STATE(CredentialAttributeType.STRING,"resident_state", "Resident state", "The state, province, district, or local area where the PID holder currently resides", false),
RESIDENT_COUNTRY(CredentialAttributeType.STRING,"resident_country", "Resident country", "The country where the PID holder currently resides", false),
GENDER(CredentialAttributeType.STRING,"gender", "Gender", "PID holder’s gender", false),
NATIONALITY(CredentialAttributeType.STRING,"nationality", "Nationality", "Alpha-2 country code", true),
PORTRAIT(CredentialAttributeType.PICTURE,"portrait", "FacialImage/Portrait", "A reproduction of the PID holder’s portrait", false),
PORTRAIT_CAPTURE_DATE(CredentialAttributeType.DATE,"portrait_capture_date", "Portrait image timestamp", "Date when portrait was taken", false),
BIOMETRIC_TEMPLATE_FINGER(CredentialAttributeType.PICTURE,"biometric_template_finger", "Fingerprint", "Fingerprint", false),
AGE_OVER_13(CredentialAttributeType.BOOLEAN,"age_over_13", "Age over 13?", "Age over 13?", false),
AGE_OVER_16(CredentialAttributeType.BOOLEAN,"age_over_16", "Age over 16?", "Age over 16?", false),
AGE_OVER_18(CredentialAttributeType.BOOLEAN,"age_over_18", "Age over 18?", "Age over 18?", false),
AGE_OVER_21(CredentialAttributeType.BOOLEAN,"age_over_21", "Age over 21?", "Age over 21?", false),
AGE_OVER_60(CredentialAttributeType.BOOLEAN,"age_over_60", "Age over 60?", "Age over 60?", false),
AGE_OVER_65(CredentialAttributeType.BOOLEAN,"age_over_65", "Age over 65?", "Age over 65?", false),
AGE_OVER_68(CredentialAttributeType.BOOLEAN,"age_over_68", "Age over 68?", "Age over 68?", false),
AGE_IN_YEARS(CredentialAttributeType.NUMBER,"age_in_years", "How old are you (in years)?", "The age of the PID holder in years", false),
AGE_BIRTH_YEAR(CredentialAttributeType.NUMBER,"age_birth_year", "In what year were you born?", "The year when the PID holder was born", false),
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ object NamespaceMdl: MdocNamespace(){
BIOMETRIC_TEMPLATE_IRIS(CredentialAttributeType.PICTURE, "biometric_template_iris", "Biometric template iris", "Iris of the mDL holder", false),
FAMILY_NAME_NATIONAL_CHARACTER(CredentialAttributeType.STRING, "family_name_national_character", "Family name in national characters", "The family name of the mDL holder", false),
GIVEN_NAME_NATIONAL_CHARACTER(CredentialAttributeType.STRING, "given_name_national_character", "Given name in national characters", "The given name of the mDL holder", false),
SIGNATURE_USUAL_MARK(CredentialAttributeType.PICTURE, "signature_usual_mark", "Signature / usual mark", "Image of the signature or usual mark of the mDL holder,", false)
SIGNATURE_USUAL_MARK(CredentialAttributeType.PICTURE, "signature_usual_mark", "Signature / usual mark", "Image of the signature or usual mark of the mDL holder,", false),

// details of DRIVING_PRIVILEGES
DRIVING_PRIVILEGES_VEHICLE_CATEGORY_CODE(CredentialAttributeType.STRING, "vehicle_category_code", "Vehicle category code", "Vehicle category code", true),
DRIVING_PRIVILEGES_VEHICLE_ISSUE_DATE(CredentialAttributeType.DATE, "issue_date", "Date of issue", "Date of issue", false),
DRIVING_PRIVILEGES_VEHICLE_EXPIRY_DATE(CredentialAttributeType.DATE, "expiry_date", "Date of expiry", "Date of expiry", false),
DRIVING_PRIVILEGES_VEHICLE_CODES(CredentialAttributeType.CBOR, "codes", "Codes of driving privileges", "Codes of driving privileges", false),

// details of DRIVING_PRIVILEGES_VEHICLE_CODES
DRIVING_PRIVILEGES_VEHICLE_CODE_CODE(CredentialAttributeType.STRING, "code", "Code", "Code", true),
DRIVING_PRIVILEGES_VEHICLE_CODE_SIGN(CredentialAttributeType.STRING, "sign", "Sign", "Sign", false),
DRIVING_PRIVILEGES_VEHICLE_CODE_VALUE(CredentialAttributeType.STRING, "value", "Value", "Value", false),
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,24 @@ object NamespaceMdlAamva : MdocNamespace(){
RESIDENT_COUNTY(CredentialAttributeType.STRING, "resident_county", "Resident country", "The 3-digit county code of the county where the mDL holder lives", false),
HAZMAT_ENDORSEMENT_EXPIRATION_DATE(CredentialAttributeType.DATE_TIME, "hazmat_endorsement_expiration_date", "HAZMAT endorsement expiration date", "Date on which the hazardous material endorsement granted by the document is no longer valid.", false),
SEX(CredentialAttributeType.NUMBER, "sex", "Sex", "mDL holder’s sex", false),

// details of DOMESTIC_DRIVING_PRIVILEGES
DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_CLASS(CredentialAttributeType.CBOR, "domestic_vehicle_class", "Domestic vehicle class", "Domestic vehicle class", true),
DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_RESTRICTIONS(CredentialAttributeType.CBOR, "domestic_vehicle_restrictions", "Domestic vehicle restrictions", "Domestic vehicle restrictions", true),
DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_ENDORSEMENTS(CredentialAttributeType.CBOR, "domestic_vehicle_endorsements", "Domestic vehicle endorsements", "Domestic vehicle endorsements", true),

// details of DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_CLASS
DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_CLASS_CODE(CredentialAttributeType.STRING, "domestic_vehicle_class_code", "Domestic vehicle class code", "Vehicle category code", true),
DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_CLASS_DESCRIPTION(CredentialAttributeType.STRING, "domestic_vehicle_class_description", "Domestic vehicle class description", "Vehicle category description", true),
DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_CLASS_ISSUE_DATE(CredentialAttributeType.DATE, "issue_date", "Date of issue", "Date of issue", false),
DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_CLASS_EXPIRY_DATE(CredentialAttributeType.DATE, "expiry_date", "Date of expiry", "Date of expiry", false),

// details of DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_RESTRICTIONS
DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_RESTRICTION_CODE(CredentialAttributeType.STRING, "domestic_vehicle_restriction_code", "Restriction code", "Restriction code", false),
DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_RESTRICTION_DESCRIPTION(CredentialAttributeType.STRING, "domestic_vehicle_restriction_description", "Vehicle category description", "Vehicle category description", true),

// details of DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_ENDORSEMENTS
DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_ENDORSEMENT_CODE(CredentialAttributeType.STRING, "domestic_vehicle_endorsement_code", "Endorsement code", "Endorsement code", false),
DOMESTIC_DRIVING_PRIVILEGE_VEHICLE_ENDORSEMENT_DESCRIPTION(CredentialAttributeType.STRING, "domestic_vehicle_endorsement_description", "Vehicle endorsement description", "Vehicle endorsement description", true),
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,32 @@ object NamespaceMicovAtt : MdocNamespace() {
override val namespace = "org.micov.attestation.1"
override val dataElements: List<MdocDataElement> = Element.values().asList()

// TODO: check description/mandatory
enum class Element(
override val type: CredentialAttributeType,
override val identifier: String,
override val displayName: String,
override val description: String,
override val mandatory: Boolean
) : MdocDataElement {
INDICATION_OF_VACCINATION_YELLOW_FEVER(CredentialAttributeType.NUMBER,"1D47_vaccinated", "Indication of vaccination against Yellow Fever", "Indication of vaccination against Yellow Fever", true),
INDICATION_OF_VACCINATION_COVID_19(CredentialAttributeType.NUMBER,"RA01_vaccinated", "Indication of vaccination against COVID-19", "Indication of vaccination against COVID-19", true),
INDICATION_OF_TEST_EVENT_COVID_19(CredentialAttributeType.NUMBER,"RA01_test", "Indication of test event for COVID-19", "Indication of test event for COVID-19", true),
SAFE_ENTRY_INDICATION(CredentialAttributeType.CBOR,"safeEntry_Leisure", "Safe entry indication", "Safe entry indication", true),
FACIAL_IMAGE(CredentialAttributeType.PICTURE,"fac", "Facial Image", "Facial Image", true),
FAMILY_NAME_INITIAL(CredentialAttributeType.STRING,"fni", "Family Name Initial", "Family Name Initial", true),
GIVEN_AME_INITIAL(CredentialAttributeType.STRING,"gni", "Given Name Initial", "Given Name Initial", true),
BIRTH_YEAR(CredentialAttributeType.NUMBER, "by", "Birth Year", "Birth Year", true),
BIRTH_MONTH(CredentialAttributeType.NUMBER, "bm", "Birth Month", "Birth Month", true),
BIRTH_DAY(CredentialAttributeType.NUMBER, "bd", "Birth Day", "Birth Day", true)
INDICATION_OF_VACCINATION_YELLOW_FEVER(CredentialAttributeType.BOOLEAN,"1D47_vaccinated", "Indication of vaccination against Yellow Fever", "Attestation that the holder has been fully vaccinated against Yellow Fever", false),
INDICATION_OF_VACCINATION_COVID_19(CredentialAttributeType.BOOLEAN,"RA01_vaccinated", "Indication of vaccination against COVID-19", "Attestation that the holder has been fully vaccinated against COVID-19", false),
INDICATION_OF_TEST_EVENT_COVID_19(CredentialAttributeType.CBOR,"RA01_test", "Indication of test event for COVID-19", "Attestation that the holder has obtained a negative test for COVID-19", false),
SAFE_ENTRY_INDICATION(CredentialAttributeType.CBOR,"safeEntry_Leisure", "Safe entry indication", "Attest that the holder fulfils certain set requirements for safe entry in a leisure context (without disclosing if it is based on vaccination, recovery, or negative test)", false),
FACIAL_IMAGE(CredentialAttributeType.PICTURE,"fac", "Facial Image", "Facial Image of the holder", false),
FAMILY_NAME_INITIAL(CredentialAttributeType.STRING,"fni", "Family Name Initial", "Initial letter of the Family Name of the holder", false),
GIVEN_AME_INITIAL(CredentialAttributeType.STRING,"gni", "Given Name Initial", "Initial letter of the Given Name of the holder", false),
BIRTH_YEAR(CredentialAttributeType.NUMBER, "by", "Birth Year", "Birth Year of the holder", false),
BIRTH_MONTH(CredentialAttributeType.NUMBER, "bm", "Birth Month", "Birth Month of the holder", false),
BIRTH_DAY(CredentialAttributeType.NUMBER, "bd", "Birth Day", "Birth Day of the holder", false),

// details of INDICATION_OF_TEST_EVENT_COVID_19
TEST_ENCODING_RESULT(CredentialAttributeType.STRING, "Result", "Test result", "Test result", true),
TEST_ENCODING_TYPE_OF_TEST(CredentialAttributeType.STRING, "TypeOfTest", "Type of test", "Type of test, e.g. PCR test", true),
TEST_ENCODING_TIME_OF_TEST(CredentialAttributeType.DATE_TIME, "TimeOfTest", "Time of test", "Time of test", true),

// details of SAFE_ENTRY_INDICATION
SAFE_ENTRY_ENCODING_SECOND_FULLFILLED(CredentialAttributeType.BOOLEAN,"SeCondFulfilled", "Second fulfilled", "Second fulfilled", true),
SAFE_ENTRY_ENCODING_SECOND_TYPE(CredentialAttributeType.STRING,"SeCondType", "Second type", "Second type", true),
SAFE_ENTRY_ENCODING_SECOND_EXPIRY(CredentialAttributeType.DATE,"SeCondExpiry", "Second expiry", "Second expiry", true),
}
}
Loading

0 comments on commit 688fa6a

Please sign in to comment.