-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
1,542 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
dif-data-classes/src/commonMain/kotlin/at/asitplus/dif/FormatContainerJwt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
package at.asitplus.dif | ||
|
||
import at.asitplus.signum.indispensable.josef.JsonWebAlgorithm | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.Transient | ||
|
||
/** | ||
* Data class for | ||
* [DIF Presentation Exchange v1.0.0](https://identity.foundation/presentation-exchange/spec/v1.0.0/#presentation-definition) | ||
*/ | ||
@Serializable | ||
data class FormatContainerJwt( | ||
// TODO make this a collection of Json Web Algorithms from kmp-crypto | ||
@SerialName("alg") | ||
val algorithms: Collection<String>? = null, | ||
) | ||
val algorithmStrings: Collection<String>? = null, | ||
) { | ||
@Transient | ||
val algorithms: Set<JsonWebAlgorithm>? = algorithmStrings | ||
?.mapNotNull { s -> JsonWebAlgorithm.entries.firstOrNull { it.identifier == s } }?.toSet() | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[versions] | ||
kmmresult = "1.8.0!!" |
44 changes: 44 additions & 0 deletions
44
openid-data-classes/src/commonMain/kotlin/at/asitplus/openid/JwtVcIssuerMetadata.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package at.asitplus.openid | ||
|
||
import at.asitplus.KmmResult | ||
import at.asitplus.KmmResult.Companion.wrap | ||
import at.asitplus.signum.indispensable.josef.JsonWebKeySet | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.encodeToString | ||
|
||
/** | ||
* Metadata about the credential issuer in | ||
* [SD-JWT VC](https://www.ietf.org/archive/id/draft-ietf-oauth-sd-jwt-vc-05.html) | ||
* | ||
* To be serialized into JSON and made available at `/.well-known/jwt-vc-issuer` at the credential issuer. | ||
*/ | ||
@Serializable | ||
data class JwtVcIssuerMetadata( | ||
/** | ||
* REQUIRED. The Issuer identifier, which MUST be identical to the `iss` value in the JWT. | ||
*/ | ||
@SerialName("issuer") | ||
val issuer: String, | ||
|
||
/** | ||
* OPTIONAL. Issuer's JSON Web Key Set (RFC7517) document value, which contains the Issuer's public keys. | ||
* The value of this field MUST be a JSON object containing a valid JWK Set. | ||
*/ | ||
@SerialName("jwks") | ||
val jsonWebKeySet: JsonWebKeySet? = null, | ||
|
||
/** | ||
* OPTIONAL. URL string referencing the Issuer's JSON Web Key (JWK) Set (RFC7517) document which contains the | ||
* Issuer's public keys. The value of this field MUST point to a valid JWK Set document. | ||
*/ | ||
@SerialName("jwks_uri") | ||
val jsonWebKeySetUrl: String? = null, | ||
) { | ||
fun serialize() = jsonSerializer.encodeToString(this) | ||
|
||
companion object { | ||
fun deserialize(input: String): KmmResult<JwtVcIssuerMetadata> = | ||
runCatching { jsonSerializer.decodeFromString<JwtVcIssuerMetadata>(input) }.wrap() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.