-
Notifications
You must be signed in to change notification settings - Fork 1
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
15 changed files
with
284 additions
and
257 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
17 changes: 17 additions & 0 deletions
17
src/main/kotlin/com/rootsid/wal/library/didcom/model/UnpackResult.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,17 @@ | ||
package com.rootsid.wal.library.didcom.model | ||
|
||
/** | ||
* Unpack result | ||
* | ||
* @property message | ||
* @property from | ||
* @property to | ||
* @property res | ||
* @constructor Create empty Unpack result | ||
*/ | ||
data class UnpackResult( | ||
val message: String, | ||
val from: String?, | ||
val to: String, | ||
val res: org.didcommx.didcomm.model.UnpackResult | ||
) |
2 changes: 1 addition & 1 deletion
2
...tsid/wal/library/didcom/SecretResolver.kt → .../library/didcom/storage/SecretResolver.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
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
2 changes: 1 addition & 1 deletion
2
src/main/kotlin/com/rootsid/wal/library/wallet/WalletService.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
28 changes: 28 additions & 0 deletions
28
src/main/kotlin/com/rootsid/wal/library/wallet/model/BlockchainTxLogEntry.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,28 @@ | ||
package com.rootsid.wal.library.wallet.model | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* Blockchain tx log | ||
* | ||
* @property txId transaction id | ||
* @property action one of ADD_KEY, REVOKE_KEY, PUBLISH_DID, ISSUE_CREDENTIAL, REVOKE_CREDENTIAL | ||
* @property url to open the transaction on a blockchain explorer | ||
* @constructor Create empty Blockchain tx log | ||
*/ | ||
@Serializable | ||
data class BlockchainTxLogEntry( | ||
val txId: String, | ||
val action: BlockchainTxAction, | ||
val url: String, | ||
val description: String? | ||
) | ||
|
||
// Enum for blockchain tx actions | ||
enum class BlockchainTxAction { | ||
ADD_KEY, | ||
REVOKE_KEY, | ||
PUBLISH_DID, | ||
ISSUE_CREDENTIAL, | ||
REVOKE_CREDENTIAL | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/kotlin/com/rootsid/wal/library/wallet/model/Claim.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,32 @@ | ||
package com.rootsid.wal.library.wallet.model | ||
|
||
import io.iohk.atala.prism.api.CredentialClaim | ||
import io.iohk.atala.prism.identity.PrismDid | ||
import kotlinx.serialization.ExperimentalSerializationApi | ||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.decodeFromString | ||
import kotlinx.serialization.json.Json | ||
|
||
/** | ||
* Claim | ||
* | ||
* @property subjectDid | ||
* @property content | ||
* @constructor Create empty Claim | ||
*/ | ||
@Serializable | ||
data class Claim( | ||
val subjectDid: String, | ||
val content: String | ||
) | ||
|
||
/** | ||
* To credential claim | ||
* | ||
* Convert a Claim to PRISM CredentialClaim | ||
*/ | ||
@OptIn(ExperimentalSerializationApi::class) | ||
fun Claim.toCredentialClaim() = CredentialClaim( | ||
PrismDid.fromString(this.subjectDid), | ||
Json.decodeFromString(this.content) | ||
) |
17 changes: 17 additions & 0 deletions
17
src/main/kotlin/com/rootsid/wal/library/wallet/model/ImportedCredential.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,17 @@ | ||
package com.rootsid.wal.library.wallet.model | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* Imported credential | ||
* | ||
* @property alias | ||
* @property verifiedCredential | ||
* @constructor Create empty Imported credential | ||
*/ | ||
@Serializable | ||
data class ImportedCredential( | ||
val alias: String, | ||
// Signed VC and proof (This is the real VC) | ||
var verifiedCredential: VerifiedCredential, | ||
) |
33 changes: 33 additions & 0 deletions
33
src/main/kotlin/com/rootsid/wal/library/wallet/model/IssuedCredential.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,33 @@ | ||
package com.rootsid.wal.library.wallet.model | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
/** | ||
* Credential | ||
* | ||
* @property alias | ||
* @property issuingDidAlias | ||
* @property claim | ||
* @property verifiedCredential | ||
* @property batchId | ||
* @property credentialHash | ||
* @property operationHash | ||
* @property revoked | ||
* @constructor Create empty Credential | ||
*/ | ||
@Serializable | ||
data class IssuedCredential( | ||
val alias: String, | ||
var issuingDidAlias: String, | ||
// Plain json claim | ||
val claim: Claim, | ||
// Signed VC and proof (This is the real VC) | ||
var verifiedCredential: VerifiedCredential, | ||
// Required for revocation | ||
var batchId: String, | ||
// Required for revocation | ||
var credentialHash: String, | ||
// Required for revocation | ||
var operationHash: String, | ||
var revoked: Boolean | ||
) |
Oops, something went wrong.