diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/-mso-mdoc-item.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/-mso-mdoc-item.md
new file mode 100644
index 0000000..6e79fc8
--- /dev/null
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/-mso-mdoc-item.md
@@ -0,0 +1,8 @@
+//[transfer-manager](../../../index.md)/[eu.europa.ec.eudi.iso18013.transfer.response.device](../index.md)/[MsoMdocItem](index.md)/[MsoMdocItem](-mso-mdoc-item.md)
+
+# MsoMdocItem
+
+[androidJvm]\
+constructor(
+namespace: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html),
+elementIdentifier: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html))
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/element-identifier.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/element-identifier.md
new file mode 100644
index 0000000..de9c213
--- /dev/null
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/element-identifier.md
@@ -0,0 +1,7 @@
+//[transfer-manager](../../../index.md)/[eu.europa.ec.eudi.iso18013.transfer.response.device](../index.md)/[MsoMdocItem](index.md)/[elementIdentifier](element-identifier.md)
+
+# elementIdentifier
+
+[androidJvm]\
+open override
+val [elementIdentifier](element-identifier.md): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/index.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/index.md
new file mode 100644
index 0000000..cf669e1
--- /dev/null
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/index.md
@@ -0,0 +1,24 @@
+//[transfer-manager](../../../index.md)/[eu.europa.ec.eudi.iso18013.transfer.response.device](../index.md)/[MsoMdocItem](index.md)
+
+# MsoMdocItem
+
+[androidJvm]\
+data class [MsoMdocItem](index.md)(val
+namespace: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val
+elementIdentifier: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) : [DocItem](../../eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/index.md)
+
+Represents a [DocItem](../../eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/index.md) for
+mso_mdoc document items. Includes the namespace and element identifier of the document item.
+
+## Constructors
+
+| | |
+|----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| [MsoMdocItem](-mso-mdoc-item.md) | [androidJvm]
constructor(namespace: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), elementIdentifier: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) |
+
+## Properties
+
+| Name | Summary |
+|--------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| [elementIdentifier](element-identifier.md) | [androidJvm]
open override val [elementIdentifier](element-identifier.md): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
The element identifier of the MsoMdocItem. |
+| [namespace](namespace.md) | [androidJvm]
val [namespace](namespace.md): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
The namespace of the element. |
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/namespace.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/namespace.md
similarity index 68%
rename from docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/namespace.md
rename to docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/namespace.md
index 9ab71ee..6946700 100644
--- a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/namespace.md
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/namespace.md
@@ -1,4 +1,4 @@
-//[transfer-manager](../../../index.md)/[eu.europa.ec.eudi.iso18013.transfer.response](../index.md)/[DocItem](index.md)/[namespace](namespace.md)
+//[transfer-manager](../../../index.md)/[eu.europa.ec.eudi.iso18013.transfer.response.device](../index.md)/[MsoMdocItem](index.md)/[namespace](namespace.md)
# namespace
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/index.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/index.md
index 198f73e..a14a9fb 100644
--- a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/index.md
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/index.md
@@ -9,4 +9,5 @@
| [DeviceRequest](-device-request/index.md) | [androidJvm]
data class [DeviceRequest](-device-request/index.md)(val deviceRequestBytes: [DeviceRequestBytes](../eu.europa.ec.eudi.iso18013.transfer/-device-request-bytes/index.md), val sessionTranscriptBytes: [SessionTranscriptBytes](../eu.europa.ec.eudi.iso18013.transfer/-session-transcript-bytes/index.md)) : [Request](../eu.europa.ec.eudi.iso18013.transfer.response/-request/index.md)
Represents a Device Request according to ISO 18013-5 standard. |
| [DeviceRequestProcessor](-device-request-processor/index.md) | [androidJvm]
class [DeviceRequestProcessor](-device-request-processor/index.md)(documentManager: DocumentManager, var readerTrustStore: [ReaderTrustStore](../eu.europa.ec.eudi.iso18013.transfer.readerauth/-reader-trust-store/index.md)? = null) : [RequestProcessor](../eu.europa.ec.eudi.iso18013.transfer.response/-request-processor/index.md), [ReaderTrustStoreAware](../eu.europa.ec.eudi.iso18013.transfer.readerauth/-reader-trust-store-aware/index.md)
Implementation of [RequestProcessor](../eu.europa.ec.eudi.iso18013.transfer.response/-request-processor/index.md) for [DeviceRequest](-device-request/index.md) for the ISO 18013-5 standard. |
| [DeviceResponse](-device-response/index.md) | [androidJvm]
data class [DeviceResponse](-device-response/index.md)(val deviceResponseBytes: [DeviceResponseBytes](../eu.europa.ec.eudi.iso18013.transfer/-device-response-bytes/index.md)) : [Response](../eu.europa.ec.eudi.iso18013.transfer.response/-response/index.md)
Represents a Device Response according to ISO 18013-5 standard. |
+| [MsoMdocItem](-mso-mdoc-item/index.md) | [androidJvm]
data class [MsoMdocItem](-mso-mdoc-item/index.md)(val namespace: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val elementIdentifier: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) : [DocItem](../eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/index.md)
Represents a [DocItem](../eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/index.md) for mso_mdoc document items. Includes the namespace and element identifier of the document item. |
| [ProcessedDeviceRequest](-processed-device-request/index.md) | [androidJvm]
class [ProcessedDeviceRequest](-processed-device-request/index.md)(documentManager: DocumentManager, sessionTranscript: [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html), val requestedDocuments: [RequestedDocuments](../eu.europa.ec.eudi.iso18013.transfer.response/-requested-documents/index.md)) : [RequestProcessor.ProcessedRequest.Success](../eu.europa.ec.eudi.iso18013.transfer.response/-request-processor/-processed-request/-success/index.md)
Implementation of [RequestProcessor.ProcessedRequest.Success](../eu.europa.ec.eudi.iso18013.transfer.response/-request-processor/-processed-request/-success/index.md) for [DeviceRequest](-device-request/index.md). |
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-disclosed-document/index.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-disclosed-document/index.md
index 64b3c12..cb5d1e0 100644
--- a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-disclosed-document/index.md
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-disclosed-document/index.md
@@ -20,5 +20,5 @@ Represents a response that contains the document data that will be sent to an md
| Name | Summary |
|--------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [disclosedItems](disclosed-items.md) | [androidJvm]
val [disclosedItems](disclosed-items.md): [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[DocItem](../-doc-item/index.md)>
a [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html) that contains the document items [DocItem](../-doc-item/index.md), i.e the namespaces and the data elements that will be sent in the device response after selective disclosure |
-| [documentId](document-id.md) | [androidJvm]
val [documentId](document-id.md): DocumentId
the unique id of the document stored in identity credential api |
+| [documentId](document-id.md) | [androidJvm]
val [documentId](document-id.md): DocumentId
the unique id of the document |
| [keyUnlockData](key-unlock-data.md) | [androidJvm]
val [keyUnlockData](key-unlock-data.md): KeyUnlockData? = null
the key unlock data that will be used to unlock document's key for signing the response |
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/-doc-item.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/-doc-item.md
index 030e59c..e05f895 100644
--- a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/-doc-item.md
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/-doc-item.md
@@ -4,5 +4,4 @@
[androidJvm]\
constructor(
-namespace: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html),
elementIdentifier: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html))
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/element-identifier.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/element-identifier.md
index 6f26d0a..9f3e273 100644
--- a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/element-identifier.md
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/element-identifier.md
@@ -3,4 +3,5 @@
# elementIdentifier
[androidJvm]\
+open
val [elementIdentifier](element-identifier.md): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/equals.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/equals.md
new file mode 100644
index 0000000..1fe81fe
--- /dev/null
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/equals.md
@@ -0,0 +1,7 @@
+//[transfer-manager](../../../index.md)/[eu.europa.ec.eudi.iso18013.transfer.response](../index.md)/[DocItem](index.md)/[equals](equals.md)
+
+# equals
+
+[androidJvm]\
+open operator override fun [equals](equals.md)(
+other: [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/hash-code.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/hash-code.md
new file mode 100644
index 0000000..a94b026
--- /dev/null
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/hash-code.md
@@ -0,0 +1,7 @@
+//[transfer-manager](../../../index.md)/[eu.europa.ec.eudi.iso18013.transfer.response](../index.md)/[DocItem](index.md)/[hashCode](hash-code.md)
+
+# hashCode
+
+[androidJvm]\
+open override
+fun [hashCode](hash-code.md)(): [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/index.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/index.md
index 72f12ad..50e65c8 100644
--- a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/index.md
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/index.md
@@ -2,22 +2,32 @@
# DocItem
-[androidJvm]\
-data class [DocItem](index.md)(val
-namespace: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val
+open class [DocItem](index.md)(val
elementIdentifier: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html))
Doc item represents a data element
+#### Inheritors
+
+| |
+|--------------------------------------------------------------------------------------------------|
+| [MsoMdocItem](../../eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/index.md) |
+
## Constructors
-| | |
-|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| [DocItem](-doc-item.md) | [androidJvm]
constructor(namespace: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), elementIdentifier: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) |
+| | |
+|-------------------------|----------------------------------------------------------------------------------------------------------------------------------|
+| [DocItem](-doc-item.md) | [androidJvm]
constructor(elementIdentifier: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)) |
## Properties
-| Name | Summary |
-|--------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| [elementIdentifier](element-identifier.md) | [androidJvm]
val [elementIdentifier](element-identifier.md): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
the data element identifier e.g. family_name, given_name |
-| [namespace](namespace.md) | [androidJvm]
val [namespace](namespace.md): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
the namespace that the element belong to, e.g. eu.europa.ec.eudiw.pid.1 |
+| Name | Summary |
+|--------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| [elementIdentifier](element-identifier.md) | [androidJvm]
open val [elementIdentifier](element-identifier.md): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
the data element identifier e.g. family_name, given_name |
+
+## Functions
+
+| Name | Summary |
+|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| [equals](equals.md) | [androidJvm]
open operator override fun [equals](equals.md)(other: [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
+| [hashCode](hash-code.md) | [androidJvm]
open override fun [hashCode](hash-code.md)(): [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) |
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-requested-document/-requested-document.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-requested-document/-requested-document.md
index eb06eb8..99f04a0 100644
--- a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-requested-document/-requested-document.md
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-requested-document/-requested-document.md
@@ -5,5 +5,5 @@
[androidJvm]\
constructor(documentId: DocumentId,
requestedItems: [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)
-<[DocItem](../-doc-item/index.md), [IntentToRetain](../../eu.europa.ec.eudi.iso18013.transfer/-intent-to-retain/index.md)
+<out [DocItem](../-doc-item/index.md), [IntentToRetain](../../eu.europa.ec.eudi.iso18013.transfer/-intent-to-retain/index.md)
>, readerAuth: [ReaderAuth](../-reader-auth/index.md)?)
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-requested-document/index.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-requested-document/index.md
index ecb8f1b..04ae5de 100644
--- a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-requested-document/index.md
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-requested-document/index.md
@@ -5,21 +5,21 @@
[androidJvm]\
data class [RequestedDocument](index.md)(val documentId: DocumentId, val
requestedItems: [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)
-<[DocItem](../-doc-item/index.md), [IntentToRetain](../../eu.europa.ec.eudi.iso18013.transfer/-intent-to-retain/index.md)
+<out [DocItem](../-doc-item/index.md), [IntentToRetain](../../eu.europa.ec.eudi.iso18013.transfer/-intent-to-retain/index.md)
>, val readerAuth: [ReaderAuth](../-reader-auth/index.md)?)
Represents a request received by a verifier and contains the requested documents and elements
## Constructors
-| | |
-|---------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| [RequestedDocument](-requested-document.md) | [androidJvm]
constructor(documentId: DocumentId, requestedItems: [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)<[DocItem](../-doc-item/index.md), [IntentToRetain](../../eu.europa.ec.eudi.iso18013.transfer/-intent-to-retain/index.md)>, readerAuth: [ReaderAuth](../-reader-auth/index.md)?) |
+| | |
+|---------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| [RequestedDocument](-requested-document.md) | [androidJvm]
constructor(documentId: DocumentId, requestedItems: [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)<out [DocItem](../-doc-item/index.md), [IntentToRetain](../../eu.europa.ec.eudi.iso18013.transfer/-intent-to-retain/index.md)>, readerAuth: [ReaderAuth](../-reader-auth/index.md)?) |
## Properties
-| Name | Summary |
-|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| [documentId](document-id.md) | [androidJvm]
val [documentId](document-id.md): DocumentId
the unique id of the document stored in identity credential api |
-| [readerAuth](reader-auth.md) | [androidJvm]
val [readerAuth](reader-auth.md): [ReaderAuth](../-reader-auth/index.md)?
the result of the reader authentication |
-| [requestedItems](requested-items.md) | [androidJvm]
val [requestedItems](requested-items.md): [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)<[DocItem](../-doc-item/index.md), [IntentToRetain](../../eu.europa.ec.eudi.iso18013.transfer/-intent-to-retain/index.md)>
the list of requested items |
+| Name | Summary |
+|--------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| [documentId](document-id.md) | [androidJvm]
val [documentId](document-id.md): DocumentId
the unique id of the document |
+| [readerAuth](reader-auth.md) | [androidJvm]
val [readerAuth](reader-auth.md): [ReaderAuth](../-reader-auth/index.md)?
the result of the reader authentication |
+| [requestedItems](requested-items.md) | [androidJvm]
val [requestedItems](requested-items.md): [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)<out [DocItem](../-doc-item/index.md), [IntentToRetain](../../eu.europa.ec.eudi.iso18013.transfer/-intent-to-retain/index.md)>
the list of requested items |
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-requested-document/requested-items.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-requested-document/requested-items.md
index f3216c9..1e44d31 100644
--- a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-requested-document/requested-items.md
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-requested-document/requested-items.md
@@ -4,5 +4,5 @@
[androidJvm]\
val [requestedItems](requested-items.md): [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)
-<[DocItem](../-doc-item/index.md), [IntentToRetain](../../eu.europa.ec.eudi.iso18013.transfer/-intent-to-retain/index.md)
+<out [DocItem](../-doc-item/index.md), [IntentToRetain](../../eu.europa.ec.eudi.iso18013.transfer/-intent-to-retain/index.md)
>
diff --git a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/index.md b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/index.md
index 7eafa90..4ebfaf3 100644
--- a/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/index.md
+++ b/docs/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/index.md
@@ -8,10 +8,10 @@
|-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [DisclosedDocument](-disclosed-document/index.md) | [androidJvm]
data class [DisclosedDocument](-disclosed-document/index.md)(val documentId: DocumentId, val disclosedItems: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[DocItem](-doc-item/index.md)>, val keyUnlockData: KeyUnlockData? = null)
Represents a response that contains the document data that will be sent to an mdoc verifier |
| [DisclosedDocuments](-disclosed-documents/index.md) | [androidJvm]
class [DisclosedDocuments](-disclosed-documents/index.md)(documents: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[DisclosedDocument](-disclosed-document/index.md)> = emptyList()) : [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[DisclosedDocument](-disclosed-document/index.md)>
The list of disclosed documents, the documents and their elements that the holder has disclosed to the verifier. |
-| [DocItem](-doc-item/index.md) | [androidJvm]
data class [DocItem](-doc-item/index.md)(val namespace: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), val elementIdentifier: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html))
Doc item represents a data element |
+| [DocItem](-doc-item/index.md) | [androidJvm]
open class [DocItem](-doc-item/index.md)(val elementIdentifier: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html))
Doc item represents a data element |
| [ReaderAuth](-reader-auth/index.md) | [androidJvm]
data class [ReaderAuth](-reader-auth/index.md)(val readerAuth: [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html), val readerSignIsValid: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html), val readerCertificateChain: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[X509Certificate](https://developer.android.com/reference/kotlin/java/security/cert/X509Certificate.html)>, val readerCertificatedIsTrusted: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html), val readerCommonName: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html))
Reader authentication |
| [Request](-request/index.md) | [androidJvm]
interface [Request](-request/index.md)
Interface for request |
-| [RequestedDocument](-requested-document/index.md) | [androidJvm]
data class [RequestedDocument](-requested-document/index.md)(val documentId: DocumentId, val requestedItems: [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)<[DocItem](-doc-item/index.md), [IntentToRetain](../eu.europa.ec.eudi.iso18013.transfer/-intent-to-retain/index.md)>, val readerAuth: [ReaderAuth](-reader-auth/index.md)?)
Represents a request received by a verifier and contains the requested documents and elements |
+| [RequestedDocument](-requested-document/index.md) | [androidJvm]
data class [RequestedDocument](-requested-document/index.md)(val documentId: DocumentId, val requestedItems: [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)<out [DocItem](-doc-item/index.md), [IntentToRetain](../eu.europa.ec.eudi.iso18013.transfer/-intent-to-retain/index.md)>, val readerAuth: [ReaderAuth](-reader-auth/index.md)?)
Represents a request received by a verifier and contains the requested documents and elements |
| [RequestedDocuments](-requested-documents/index.md) | [androidJvm]
class [RequestedDocuments](-requested-documents/index.md)(documents: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[RequestedDocument](-requested-document/index.md)>) : [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[RequestedDocument](-requested-document/index.md)>
Wrapper class that contains the requested documents |
| [RequestProcessor](-request-processor/index.md) | [androidJvm]
fun interface [RequestProcessor](-request-processor/index.md)
Interface for request processor. A request processor processes the raw request and returns a processed request. The processed request can be either a success or a failure. If the processed request is a success, the requested documents are returned and the response can be generated. If the processed request is a failure, the error is returned. |
| [Response](-response/index.md) | [androidJvm]
interface [Response](-response/index.md)
Interface for response |
diff --git a/docs/transfer-manager/package-list b/docs/transfer-manager/package-list
index b849e8a..04ad16e 100644
--- a/docs/transfer-manager/package-list
+++ b/docs/transfer-manager/package-list
@@ -50,6 +50,10 @@ $dokka.location:eu.europa.ec.eudi.iso18013.transfer.response.device/DeviceReques
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response.device/DeviceResponse///PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-device-response/index.md
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response.device/DeviceResponse/DeviceResponse/#kotlin.ByteArray/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-device-response/-device-response.md
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response.device/DeviceResponse/deviceResponseBytes/#/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-device-response/device-response-bytes.md
+$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response.device/MsoMdocItem///PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/index.md
+$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response.device/MsoMdocItem/MsoMdocItem/#kotlin.String#kotlin.String/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/-mso-mdoc-item.md
+$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response.device/MsoMdocItem/elementIdentifier/#/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/element-identifier.md
+$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response.device/MsoMdocItem/namespace/#/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-mso-mdoc-item/namespace.md
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response.device/ProcessedDeviceRequest///PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-processed-device-request/index.md
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response.device/ProcessedDeviceRequest/ProcessedDeviceRequest/#eu.europa.ec.eudi.wallet.document.DocumentManager#kotlin.ByteArray#eu.europa.ec.eudi.iso18013.transfer.response.RequestedDocuments/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-processed-device-request/-processed-device-request.md
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response.device/ProcessedDeviceRequest/generateResponse/#eu.europa.ec.eudi.iso18013.transfer.response.DisclosedDocuments#com.android.identity.crypto.Algorithm?/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response.device/-processed-device-request/generate-response.md
@@ -65,9 +69,10 @@ $dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/DisclosedDocuments/
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/DisclosedDocuments/DisclosedDocuments/#kotlin.Array[eu.europa.ec.eudi.iso18013.transfer.response.DisclosedDocument]/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-disclosed-documents/-disclosed-documents.md
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/DisclosedDocuments/DisclosedDocuments/#kotlin.collections.List[eu.europa.ec.eudi.iso18013.transfer.response.DisclosedDocument]/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-disclosed-documents/-disclosed-documents.md
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/DocItem///PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/index.md
-$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/DocItem/DocItem/#kotlin.String#kotlin.String/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/-doc-item.md
+$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/DocItem/DocItem/#kotlin.String/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/-doc-item.md
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/DocItem/elementIdentifier/#/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/element-identifier.md
-$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/DocItem/namespace/#/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/namespace.md
+$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/DocItem/equals/#kotlin.Any?/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/equals.md
+$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/DocItem/hashCode/#/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-doc-item/hash-code.md
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/ReaderAuth///PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-reader-auth/index.md
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/ReaderAuth/ReaderAuth/#kotlin.ByteArray#kotlin.Boolean#kotlin.collections.List[java.security.cert.X509Certificate]#kotlin.Boolean#kotlin.String/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-reader-auth/-reader-auth.md
$dokka.location:eu.europa.ec.eudi.iso18013.transfer.response/ReaderAuth/isVerified/#/PointingToDeclaration/transfer-manager/eu.europa.ec.eudi.iso18013.transfer.response/-reader-auth/is-verified.md
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index b74a948..3dca5ba 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -6,7 +6,7 @@ dependency-license-report = "2.8"
dependencycheck = "9.0.9"
dokka = "1.9.20"
espressoCore = "3.6.1"
-eudi-document-manager = "0.6.0"
+eudi-document-manager = "0.7.0-SNAPSHOT"
google-identity = "202408.1"
google-identity-android = "202408.1"
google-identity-mdoc = "202408.1"
diff --git a/licenses.md b/licenses.md
index 3996030..50c54f4 100644
--- a/licenses.md
+++ b/licenses.md
@@ -2,7 +2,7 @@
# EUDI ISO 18013-5 document transfer library
## Dependency License Report
-_2024-11-20 14:56:39 EET_
+_2024-12-04 13:16:28 EET_
## Apache License, Version 2.0
**1** **Group:** `androidx.appcompat` **Name:** `appcompat` **Version:** `1.6.1`
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 4537a39..29788fa 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -30,9 +30,9 @@ pluginManagement {
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
+ mavenLocal()
google()
mavenCentral()
- mavenLocal()
maven {
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
mavenContent { snapshotsOnly() }
diff --git a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/Extensions.kt b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/Extensions.kt
index 032729d..24fd171 100644
--- a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/Extensions.kt
+++ b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/Extensions.kt
@@ -20,6 +20,7 @@ package eu.europa.ec.eudi.iso18013.transfer
import eu.europa.ec.eudi.iso18013.transfer.response.DocItem
import eu.europa.ec.eudi.iso18013.transfer.response.RequestProcessor
import eu.europa.ec.eudi.iso18013.transfer.response.ResponseResult
+import eu.europa.ec.eudi.iso18013.transfer.response.device.MsoMdocItem
import eu.europa.ec.eudi.wallet.document.ElementIdentifier
import eu.europa.ec.eudi.wallet.document.NameSpace
@@ -30,6 +31,7 @@ import eu.europa.ec.eudi.wallet.document.NameSpace
*/
@JvmName("docItemsToNameSpaces")
fun List.asMap(): Map> = this
+ .filterIsInstance()
.groupBy { (nameSpace, _) -> nameSpace }
.mapValues { (_, docItems) -> docItems.map { it.elementIdentifier } }
@@ -42,7 +44,7 @@ fun List.asMap(): Map> = this
fun Map>.toDocItems(): List =
this.flatMap { (nameSpace, elementIdentifiers) ->
elementIdentifiers.map { elementIdentifier ->
- DocItem(
+ MsoMdocItem(
namespace = nameSpace,
elementIdentifier = elementIdentifier
)
diff --git a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/internal/AgeOverRequestLimit.kt b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/internal/AgeOverRequestLimit.kt
index 757f7eb..604404d 100644
--- a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/internal/AgeOverRequestLimit.kt
+++ b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/internal/AgeOverRequestLimit.kt
@@ -17,6 +17,7 @@
package eu.europa.ec.eudi.iso18013.transfer.internal
import eu.europa.ec.eudi.iso18013.transfer.response.DisclosedDocument
+import eu.europa.ec.eudi.iso18013.transfer.response.device.MsoMdocItem
import eu.europa.ec.eudi.wallet.document.IssuedDocument
import eu.europa.ec.eudi.wallet.document.format.MsoMdocFormat
@@ -27,9 +28,12 @@ import eu.europa.ec.eudi.wallet.document.format.MsoMdocFormat
internal fun IssuedDocument.assertAgeOverRequestLimitForIso18013(disclosedDocument: DisclosedDocument): IssuedDocument =
apply {
val docType = (format as MsoMdocFormat).docType
- if (id == disclosedDocument.documentId && docType == "org.iso.18013.5.1.mDL" && disclosedDocument.disclosedItems.filter { docItem ->
- docItem.elementIdentifier.startsWith("age_over_") && docItem.namespace == "org.iso.18013.5.1"
- }.size > 2) {
+ if (id == disclosedDocument.documentId && docType == "org.iso.18013.5.1.mDL" && disclosedDocument.disclosedItems
+ .filter { it is MsoMdocItem }
+ .filter { docItem ->
+ docItem.elementIdentifier.startsWith("age_over_") && (docItem as? MsoMdocItem)?.namespace == "org.iso.18013.5.1"
+ }.size > 2
+ ) {
throw IllegalArgumentException("Device Response is not allowed to have more than two age_over_NN elements")
}
diff --git a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/internal/DocumentResponseGenerator.kt b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/internal/DocumentResponseGenerator.kt
index fd0ee46..45b84de 100644
--- a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/internal/DocumentResponseGenerator.kt
+++ b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/internal/DocumentResponseGenerator.kt
@@ -26,7 +26,7 @@ import com.android.identity.securearea.KeyUnlockData
import eu.europa.ec.eudi.wallet.document.ElementIdentifier
import eu.europa.ec.eudi.wallet.document.IssuedDocument
import eu.europa.ec.eudi.wallet.document.NameSpace
-import eu.europa.ec.eudi.wallet.document.format.MsoMdocFormat
+import eu.europa.ec.eudi.wallet.document.format.MsoMdocData
import kotlinx.datetime.Clock
import kotlinx.datetime.toJavaInstant
@@ -54,12 +54,13 @@ internal object DocumentResponseGenerator {
keyUnlockData: KeyUnlockData? = null,
signatureAlgorithm: Algorithm = Algorithm.ES256
): ByteArray {
- require(document.format is MsoMdocFormat) { "Document format is not MsoMdocFormat" }
+ require(document.data is MsoMdocData) { "Document format is not MsoMdocFormat" }
require(!document.isKeyInvalidated) { "Document key is invalidated" }
require(document.isValidAt(Clock.System.now().toJavaInstant())) { "Document is not valid" }
- val docType = (document.format as MsoMdocFormat).docType
+ val documentData = document.data as MsoMdocData
+ val docType = documentData.format.docType
val dataElements =
- (elements ?: document.nameSpaces).flatMap { (nameSpace, elementIdentifiers) ->
+ (elements ?: documentData.nameSpaces).flatMap { (nameSpace, elementIdentifiers) ->
elementIdentifiers.map { elementIdentifier ->
DocumentRequest.DataElement(nameSpace, elementIdentifier, false)
}
@@ -68,7 +69,7 @@ internal object DocumentResponseGenerator {
val staticAuthData = StaticAuthDataParser(document.issuerProvidedData).parse()
val mergedIssuerNamespaces = MdocUtil.mergeIssuerNamesSpaces(
- request, document.nameSpacedData, staticAuthData
+ request, documentData.nameSpacedData, staticAuthData
)
return DocumentGenerator(docType, staticAuthData.issuerAuth, transcript)
.setIssuerNamespaces(mergedIssuerNamespaces)
diff --git a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/DisclosedDocument.kt b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/DisclosedDocument.kt
index 03374fa..56b1918 100644
--- a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/DisclosedDocument.kt
+++ b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/DisclosedDocument.kt
@@ -22,7 +22,7 @@ import eu.europa.ec.eudi.wallet.document.DocumentId
/**
* Represents a response that contains the document data that will be sent to an mdoc verifier
*
- * @property documentId the unique id of the document stored in identity credential api
+ * @property documentId the unique id of the document
* @property disclosedItems a [List] that contains the document items [DocItem], i.e the namespaces and the data elements that will be sent in the device response after selective disclosure
* @property keyUnlockData the key unlock data that will be used to unlock document's key for signing the response
*/
diff --git a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/DocItem.kt b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/DocItem.kt
index f2ac7a5..34954ea 100644
--- a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/DocItem.kt
+++ b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/DocItem.kt
@@ -19,10 +19,21 @@ package eu.europa.ec.eudi.iso18013.transfer.response
/**
* Doc item represents a data element
*
- * @property namespace the namespace that the element belong to, e.g. eu.europa.ec.eudiw.pid.1
* @property elementIdentifier the data element identifier e.g. family_name, given_name
*/
-data class DocItem(
- val namespace: String,
- val elementIdentifier: String
-)
\ No newline at end of file
+open class DocItem(
+ open val elementIdentifier: String
+) {
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (other !is DocItem) return false
+
+ if (elementIdentifier != other.elementIdentifier) return false
+
+ return true
+ }
+
+ override fun hashCode(): Int {
+ return elementIdentifier.hashCode()
+ }
+}
\ No newline at end of file
diff --git a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/RequestedDocument.kt b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/RequestedDocument.kt
index e3953d2..9a58ddf 100644
--- a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/RequestedDocument.kt
+++ b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/RequestedDocument.kt
@@ -22,13 +22,13 @@ import eu.europa.ec.eudi.wallet.document.DocumentId
/**
* Represents a request received by a verifier and contains the requested documents and elements
*
- * @property documentId the unique id of the document stored in identity credential api
+ * @property documentId the unique id of the document
* @property requestedItems the list of requested items
* @property readerAuth the result of the reader authentication
*/
data class RequestedDocument(
val documentId: DocumentId,
- val requestedItems: Map,
+ val requestedItems: Map,
val readerAuth: ReaderAuth?
)
\ No newline at end of file
diff --git a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/device/DeviceRequestProcessor.kt b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/device/DeviceRequestProcessor.kt
index 2c21574..c12e4c2 100644
--- a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/device/DeviceRequestProcessor.kt
+++ b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/device/DeviceRequestProcessor.kt
@@ -21,7 +21,6 @@ import eu.europa.ec.eudi.iso18013.transfer.internal.getValidIssuedMsoMdocDocumen
import eu.europa.ec.eudi.iso18013.transfer.internal.readerauth.performReaderAuthentication
import eu.europa.ec.eudi.iso18013.transfer.readerauth.ReaderTrustStore
import eu.europa.ec.eudi.iso18013.transfer.readerauth.ReaderTrustStoreAware
-import eu.europa.ec.eudi.iso18013.transfer.response.DocItem
import eu.europa.ec.eudi.iso18013.transfer.response.ReaderAuth
import eu.europa.ec.eudi.iso18013.transfer.response.Request
import eu.europa.ec.eudi.iso18013.transfer.response.RequestProcessor
@@ -92,7 +91,7 @@ class DeviceRequestProcessor(
val docItems =
requestedDocument.requested.flatMap { (nameSpace, elementIdentifiers) ->
elementIdentifiers.map { (elementIdentifier, intentToRetain) ->
- DocItem(
+ MsoMdocItem(
namespace = nameSpace,
elementIdentifier = elementIdentifier,
) to intentToRetain
diff --git a/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/device/MsoMdocItem.kt b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/device/MsoMdocItem.kt
new file mode 100644
index 0000000..7592aa0
--- /dev/null
+++ b/transfer-manager/src/main/java/eu/europa/ec/eudi/iso18013/transfer/response/device/MsoMdocItem.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2024 European Commission
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package eu.europa.ec.eudi.iso18013.transfer.response.device
+
+import eu.europa.ec.eudi.iso18013.transfer.response.DocItem
+
+/**
+ * Represents a [DocItem] for mso_mdoc document items.
+ * Includes the namespace and element identifier of the document item.
+ *
+ * @property namespace The namespace of the element.
+ * @property elementIdentifier The element identifier of the MsoMdocItem.
+ */
+data class MsoMdocItem(
+ val namespace: String,
+ override val elementIdentifier: String,
+) : DocItem(elementIdentifier)
\ No newline at end of file
diff --git a/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/ExtensionsTest.kt b/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/ExtensionsTest.kt
index 7078623..183ab98 100644
--- a/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/ExtensionsTest.kt
+++ b/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/ExtensionsTest.kt
@@ -17,9 +17,9 @@
package eu.europa.ec.eudi.iso18013.transfer
-import eu.europa.ec.eudi.iso18013.transfer.response.DocItem
import eu.europa.ec.eudi.iso18013.transfer.response.RequestProcessor
import eu.europa.ec.eudi.iso18013.transfer.response.ResponseResult
+import eu.europa.ec.eudi.iso18013.transfer.response.device.MsoMdocItem
import io.mockk.mockk
import kotlin.test.*
@@ -28,9 +28,9 @@ class ExtensionsTest {
@Test
fun docItemsAsMapShouldGroupByNamespace() {
val docItems = listOf(
- DocItem(namespace = "namespace1", elementIdentifier = "element1"),
- DocItem(namespace = "namespace1", elementIdentifier = "element2"),
- DocItem(namespace = "namespace2", elementIdentifier = "element3")
+ MsoMdocItem(namespace = "namespace1", elementIdentifier = "element1"),
+ MsoMdocItem(namespace = "namespace1", elementIdentifier = "element2"),
+ MsoMdocItem(namespace = "namespace2", elementIdentifier = "element3")
)
val result = docItems.asMap()
@@ -52,7 +52,7 @@ class ExtensionsTest {
assertEquals(3, result.size)
assertTrue(
result.contains(
- DocItem(
+ MsoMdocItem(
namespace = "namespace1",
elementIdentifier = "element1"
)
@@ -60,7 +60,7 @@ class ExtensionsTest {
)
assertTrue(
result.contains(
- DocItem(
+ MsoMdocItem(
namespace = "namespace1",
elementIdentifier = "element2"
)
@@ -68,7 +68,7 @@ class ExtensionsTest {
)
assertTrue(
result.contains(
- DocItem(
+ MsoMdocItem(
namespace = "namespace2",
elementIdentifier = "element3"
)
diff --git a/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/internal/AgeOverRequestLimitTest.kt b/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/internal/AgeOverRequestLimitTest.kt
index 46195d6..654e512 100644
--- a/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/internal/AgeOverRequestLimitTest.kt
+++ b/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/internal/AgeOverRequestLimitTest.kt
@@ -17,7 +17,7 @@
package eu.europa.ec.eudi.iso18013.transfer.internal
import eu.europa.ec.eudi.iso18013.transfer.response.DisclosedDocument
-import eu.europa.ec.eudi.iso18013.transfer.response.DocItem
+import eu.europa.ec.eudi.iso18013.transfer.response.device.MsoMdocItem
import eu.europa.ec.eudi.wallet.document.IssuedDocument
import eu.europa.ec.eudi.wallet.document.format.MsoMdocFormat
import io.mockk.every
@@ -43,9 +43,9 @@ class AgeOverRequestLimitTest {
@Test
fun `should return the issued document if the request contains 1 age_over_nn item`() {
val disclosedDocument = DisclosedDocument(
- documentId = "document_id",
+ documentId = issuedDocument.id,
disclosedItems = listOf(
- DocItem(namespace = "org.iso.18013.5.1", elementIdentifier = "age_over_18")
+ MsoMdocItem(namespace = "org.iso.18013.5.1", elementIdentifier = "age_over_18")
)
)
val document = issuedDocument.assertAgeOverRequestLimitForIso18013(disclosedDocument)
@@ -55,10 +55,10 @@ class AgeOverRequestLimitTest {
@Test
fun `should return the issued document if the request contains 2 age_over_nn item2`() {
val disclosedDocument = DisclosedDocument(
- documentId = "document_id",
+ documentId = issuedDocument.id,
disclosedItems = listOf(
- DocItem(namespace = "org.iso.18013.5.1", elementIdentifier = "age_over_18"),
- DocItem(namespace = "org.iso.18013.5.1", elementIdentifier = "age_over_21")
+ MsoMdocItem(namespace = "org.iso.18013.5.1", elementIdentifier = "age_over_18"),
+ MsoMdocItem(namespace = "org.iso.18013.5.1", elementIdentifier = "age_over_21")
)
)
val document = issuedDocument.assertAgeOverRequestLimitForIso18013(disclosedDocument)
@@ -68,11 +68,11 @@ class AgeOverRequestLimitTest {
@Test
fun `should throw the issued document if the request contains more than 2 age_over_nn items`() {
val disclosedDocument = DisclosedDocument(
- documentId = "document_id",
+ documentId = issuedDocument.id,
disclosedItems = listOf(
- DocItem(namespace = "org.iso.18013.5.1", elementIdentifier = "age_over_18"),
- DocItem(namespace = "org.iso.18013.5.1", elementIdentifier = "age_over_21"),
- DocItem(namespace = "org.iso.18013.5.1", elementIdentifier = "age_over_65")
+ MsoMdocItem(namespace = "org.iso.18013.5.1", elementIdentifier = "age_over_18"),
+ MsoMdocItem(namespace = "org.iso.18013.5.1", elementIdentifier = "age_over_21"),
+ MsoMdocItem(namespace = "org.iso.18013.5.1", elementIdentifier = "age_over_65")
)
)
val throwable = assertThrows(IllegalArgumentException::class.java) {
diff --git a/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/response/DisclosedDocumentTest.kt b/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/response/DisclosedDocumentTest.kt
index b896fe3..e62a5e6 100644
--- a/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/response/DisclosedDocumentTest.kt
+++ b/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/response/DisclosedDocumentTest.kt
@@ -17,38 +17,40 @@
package eu.europa.ec.eudi.iso18013.transfer.response
import com.android.identity.securearea.KeyUnlockData
-import eu.europa.ec.eudi.wallet.document.DocumentId
+import eu.europa.ec.eudi.wallet.document.IssuedDocument
import io.mockk.every
import io.mockk.mockk
import kotlin.test.*
class DisclosedDocumentTest {
- private lateinit var documentId: DocumentId
+ private lateinit var document: IssuedDocument
private lateinit var disclosedItems: List
private lateinit var keyUnlockData: KeyUnlockData
@BeforeTest
fun setUp() {
- documentId = "testDocumentId"
- disclosedItems = listOf(DocItem("namespace", "element"))
+ document = mockk {
+ every { id } returns "testDocumentId"
+ }
+ disclosedItems = listOf(DocItem(elementIdentifier = "element"))
keyUnlockData = mockk()
}
@Test
fun constructorShouldInitializePropertiesCorrectly() {
- val disclosedDocument = DisclosedDocument(documentId, disclosedItems, keyUnlockData)
+ val disclosedDocument = DisclosedDocument(document.id, disclosedItems, keyUnlockData)
- assertEquals(documentId, disclosedDocument.documentId)
+ assertEquals(document.id, disclosedDocument.documentId)
assertEquals(disclosedItems, disclosedDocument.disclosedItems)
assertEquals(keyUnlockData, disclosedDocument.keyUnlockData)
}
@Test
fun constructorShouldHandleNullKeyUnlockData() {
- val disclosedDocument = DisclosedDocument(documentId, disclosedItems, null)
+ val disclosedDocument = DisclosedDocument(document.id, disclosedItems, null)
- assertEquals(documentId, disclosedDocument.documentId)
+ assertEquals(document.id, disclosedDocument.documentId)
assertEquals(disclosedItems, disclosedDocument.disclosedItems)
assertNull(disclosedDocument.keyUnlockData)
}
@@ -56,17 +58,15 @@ class DisclosedDocumentTest {
@Test
fun alternativeConstructorShouldInitializePropertiesCorrectly() {
val requestedDocument = mockk()
- every { requestedDocument.documentId } returns documentId
+ every { requestedDocument.documentId } returns document.id
+ every { requestedDocument.documentId } answers { callOriginal() }
every { requestedDocument.requestedItems } returns mapOf(
- DocItem(
- "namespace",
- "element"
- ) to true
+ DocItem(elementIdentifier = "element") to true
)
val disclosedDocument = DisclosedDocument(requestedDocument, disclosedItems, keyUnlockData)
- assertEquals(documentId, disclosedDocument.documentId)
+ assertEquals(document.id, disclosedDocument.documentId)
assertEquals(disclosedItems, disclosedDocument.disclosedItems)
assertEquals(keyUnlockData, disclosedDocument.keyUnlockData)
}
@@ -74,35 +74,29 @@ class DisclosedDocumentTest {
@Test
fun alternativeConstructorShouldHandleNullDisclosedItems() {
val requestedDocument = mockk()
- every { requestedDocument.documentId } returns documentId
+ every { requestedDocument.documentId } returns document.id
every { requestedDocument.requestedItems } returns mapOf(
- DocItem(
- "namespace",
- "element"
- ) to false
+ DocItem(elementIdentifier = "element") to false
)
val disclosedDocument = DisclosedDocument(requestedDocument, null, keyUnlockData)
- assertEquals(documentId, disclosedDocument.documentId)
- assertEquals(listOf(DocItem("namespace", "element")), disclosedDocument.disclosedItems)
+ assertEquals(document.id, disclosedDocument.documentId)
+ assertEquals(listOf(DocItem("element")), disclosedDocument.disclosedItems)
assertEquals(keyUnlockData, disclosedDocument.keyUnlockData)
}
@Test
fun alternativeConstructorShouldHandleNullKeyUnlockData() {
val requestedDocument = mockk()
- every { requestedDocument.documentId } returns documentId
+ every { requestedDocument.documentId } returns document.id
every { requestedDocument.requestedItems } returns mapOf(
- DocItem(
- "namespace",
- "element"
- ) to false
+ DocItem(elementIdentifier = "element") to false
)
val disclosedDocument = DisclosedDocument(requestedDocument, disclosedItems, null)
- assertEquals(documentId, disclosedDocument.documentId)
+ assertEquals(document.id, disclosedDocument.documentId)
assertEquals(disclosedItems, disclosedDocument.disclosedItems)
assertNull(disclosedDocument.keyUnlockData)
}
diff --git a/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/response/device/DeviceRequestProcessorTest.kt b/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/response/device/DeviceRequestProcessorTest.kt
index 40987c9..b8673c0 100644
--- a/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/response/device/DeviceRequestProcessorTest.kt
+++ b/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/response/device/DeviceRequestProcessorTest.kt
@@ -25,12 +25,12 @@ import eu.europa.ec.eudi.iso18013.transfer.DocumentManagerWithoutKeyLock
import eu.europa.ec.eudi.iso18013.transfer.KeyLockPassphrase
import eu.europa.ec.eudi.iso18013.transfer.response.DisclosedDocument
import eu.europa.ec.eudi.iso18013.transfer.response.DisclosedDocuments
-import eu.europa.ec.eudi.iso18013.transfer.response.DocItem
import eu.europa.ec.eudi.iso18013.transfer.response.Request
import eu.europa.ec.eudi.iso18013.transfer.response.RequestProcessor.ProcessedRequest.Failure
import eu.europa.ec.eudi.iso18013.transfer.response.ResponseResult
import eu.europa.ec.eudi.iso18013.transfer.toDocItems
import eu.europa.ec.eudi.wallet.document.IssuedDocument
+import eu.europa.ec.eudi.wallet.document.format.MsoMdocData
import eu.europa.ec.eudi.wallet.document.format.MsoMdocFormat
import io.mockk.mockk
import org.junit.Test
@@ -54,11 +54,11 @@ class DeviceRequestProcessorTest {
assertEquals(expectedDocument.id, processedRequest.requestedDocuments[0].documentId)
assertEquals(
setOf(
- Pair(DocItem("org.iso.18013.5.1", "given_name"), true),
- Pair(DocItem("org.iso.18013.5.1", "birth_date"), true),
- Pair(DocItem("org.iso.18013.5.1", "issue_date"), true),
- Pair(DocItem("org.iso.18013.5.1", "portrait"), false),
- Pair(DocItem("org.iso.18013.5.1.Utopia", "UtopiaID"), true),
+ Pair(MsoMdocItem("org.iso.18013.5.1", "given_name"), true),
+ Pair(MsoMdocItem("org.iso.18013.5.1", "birth_date"), true),
+ Pair(MsoMdocItem("org.iso.18013.5.1", "issue_date"), true),
+ Pair(MsoMdocItem("org.iso.18013.5.1", "portrait"), false),
+ Pair(MsoMdocItem("org.iso.18013.5.1.Utopia", "UtopiaID"), true),
),
processedRequest.requestedDocuments[0].requestedItems.entries.map { it.toPair() }
.toSet()
@@ -85,12 +85,14 @@ class DeviceRequestProcessorTest {
.first()
val processedRequest = requestProcessor.process(DeviceRequest)
assertIs(processedRequest)
+ val documentData = expectedDocument.data
+ assertIs(documentData)
val responseResult = processedRequest.generateResponse(
disclosedDocuments = DisclosedDocuments(
DisclosedDocument(
documentId = expectedDocument.id,
- disclosedItems = expectedDocument.nameSpaces.toDocItems(),
+ disclosedItems = documentData.nameSpaces.toDocItems(),
)
),
signatureAlgorithm = Algorithm.ES256,
@@ -111,12 +113,14 @@ class DeviceRequestProcessorTest {
.first()
val processedRequest = requestProcessor.process(DeviceRequest)
assertIs(processedRequest)
+ val documentData = expectedDocument.data
+ assertIs(documentData)
val responseResult = processedRequest.generateResponse(
disclosedDocuments = DisclosedDocuments(
DisclosedDocument(
documentId = expectedDocument.id,
- disclosedItems = expectedDocument.nameSpaces.toDocItems(),
+ disclosedItems = documentData.nameSpaces.toDocItems(),
)
),
signatureAlgorithm = Algorithm.ES256,
@@ -137,12 +141,14 @@ class DeviceRequestProcessorTest {
.first()
val processedRequest = requestProcessor.process(DeviceRequest)
assertIs(processedRequest)
+ val documentData = expectedDocument.data
+ assertIs(documentData)
val responseResult = processedRequest.generateResponse(
disclosedDocuments = DisclosedDocuments(
DisclosedDocument(
documentId = expectedDocument.id,
- disclosedItems = expectedDocument.nameSpaces.toDocItems(),
+ disclosedItems = documentData.nameSpaces.toDocItems(),
keyUnlockData = SoftwareKeyUnlockData(KeyLockPassphrase)
)
),
diff --git a/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/response/device/MsoMdocItemTest.kt b/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/response/device/MsoMdocItemTest.kt
new file mode 100644
index 0000000..6fe7dfe
--- /dev/null
+++ b/transfer-manager/src/test/java/eu/europa/ec/eudi/iso18013/transfer/response/device/MsoMdocItemTest.kt
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2024 European Commission
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package eu.europa.ec.eudi.iso18013.transfer.response.device
+
+import kotlin.test.Test
+import kotlin.test.assertEquals
+import kotlin.test.assertNotEquals
+
+class MsoMdocItemTest {
+
+ @Test
+ fun `test equals method`() {
+ val msoMdocItem1 = MsoMdocItem(
+ namespace = "nameSpace1",
+ elementIdentifier = "elementIdentifier1",
+ )
+
+ val msoMdocItem2 = MsoMdocItem(
+ namespace = "nameSpace1",
+ elementIdentifier = "elementIdentifier1",
+ )
+
+ assertEquals(msoMdocItem1, msoMdocItem2)
+
+
+ val msoMdocItem3 = MsoMdocItem(
+ namespace = "nameSpace1",
+ elementIdentifier = "elementIdentifier1",
+ )
+
+ val msoMdocItem4 = MsoMdocItem(
+ namespace = "nameSpace2",
+ elementIdentifier = "elementIdentifier1",
+ )
+
+ assertNotEquals(msoMdocItem3, msoMdocItem4)
+ }
+}
\ No newline at end of file