:heavy_exclamation_mark: Important! Before you proceed, please read the EUDI Wallet Reference Implementation project description
The eudi-lib-jvm-presentation-exchange-kt
is a kotlin library that implements the functionality as described in
Presentation Exchange v2.
This is a specification that defines:
Verifier
to describe proof requirements in terms of PresentationDefintion
objectHolder
to describe submissions of proofs that align with those requirements in terms of a PresentationSubmission
The use of this specification is mandatory by OpenID4VP
The released software is a initial development release version:
As a Verifier
be able to
PresentationDefinition
in order to be communicated to a Holder
using a protocol like OpenID4VP
PresentationSubmission
satisfies a specific PresentationDefinition
As a Holder/Wallet
be able to
PresentationDefition
PresentationDefinition
PresentationSubmission
given a valid PresentationDefintion
and a matching Claim
The table bellow summarizes the set of optional features defined by Presentation Exchange v2 which are supported by the library. Currently, no optional features are being supported, except retention
Feature | Status |
---|---|
Submission requirement | ❌ |
Predicate | ❌ |
Relational constraint | ❌ |
Credential status constraint | ❌ |
JSON-LD framing | ❌ |
Retention | ✅ |
PresentationDefinition
Precondition:
Library should offer a factory/builder to produce the PresentationDefinition
.
The resulting PresentationDefinition
should
In order to create a presentation definition just instantiate the PresentationDefinition data class which enforces the syntactic a conditional rules as defined in the specification.
The holder should be able to verify that a JSON object is a syntactically valid PresentationDefintion
:
import eu.europa.ec.eudi.prex.*
// Decoding a presentation definition json (string)
val pdJsonStr : String = TODO("provide a presentation definition json")
val pd = PresentationExchange.parser.decodePresentationDefinition(pdJsonStr).getOrThrow()
import eu.europa.ec.eudi.prex.*
// Decoding a presentation definition json (string)
val pdJsonStr : String = TODO("provide a presentation definition json")
val pd = PresentationExchange.parser.decodePresentationDefinition(pdJsonStr).getOrThrow()
// Check whether a list of candidate claims can satisfy the
// presentation definition requirements
val candidateClaims : List<Claim> = TODO("provide a list of candidate claims")
val result = PresentationExchange.matcher.match(pd, candidateClaims)
when(result){
is Matched -> println(result.matches)
is NotMatched -> println("Not matched")
}
For a concrete example please check MatcherSample
classDiagram
class PresentationDefinition
class InputDescriptor
class FieldConstraint
class LimitDisclosure
PresentationDefinition *-- "1..*" InputDescriptor
InputDescriptor o-- "*" FieldConstraint
InputDescriptor --> "0..1" LimitDisclosure
FieldConstraint -- "1..*" Path
FieldConstraint : +Boolean optional
note for InputDescriptor "Constraints for a single claim"
We welcome contributions to this project. To ensure that the process is smooth for everyone involved, follow the guidelines found in CONTRIBUTING.md.
Copyright (c) 2023 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.