-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #295 from Concordium/identity-request
Identity request
- Loading branch information
Showing
18 changed files
with
323 additions
and
42 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
Submodule concordium-base
updated
42 files
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
31 changes: 31 additions & 0 deletions
31
concordium-sdk/src/main/java/com/concordium/sdk/crypto/wallet/Identity.java
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,31 @@ | ||
package com.concordium.sdk.crypto.wallet; | ||
|
||
import com.concordium.sdk.crypto.CryptoJniNative; | ||
import com.concordium.sdk.exceptions.CryptoJniException; | ||
import com.concordium.sdk.serializing.JsonMapper; | ||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
|
||
public class Identity { | ||
|
||
/** | ||
* Creates an identity request that is to be sent to an identity provider when | ||
* creating a new identity. | ||
* @param input the input required to generate an identity request | ||
* @return an identity request serialized as JSON | ||
*/ | ||
public static String createIdentityRequest(IdentityRequestInput input) { | ||
StringResult result = null; | ||
try { | ||
String jsonStr = CryptoJniNative.createIdentityRequestV1(JsonMapper.INSTANCE.writeValueAsString(input)); | ||
result = JsonMapper.INSTANCE.readValue(jsonStr, StringResult.class); | ||
} catch (JsonProcessingException e) { | ||
throw new RuntimeException(e); | ||
} | ||
|
||
if (!result.isSuccess()) { | ||
throw CryptoJniException.from(result.getErr()); | ||
} | ||
|
||
return result.getResult(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
concordium-sdk/src/main/java/com/concordium/sdk/crypto/wallet/IdentityRequestInput.java
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,37 @@ | ||
package com.concordium.sdk.crypto.wallet; | ||
|
||
import java.util.Map; | ||
|
||
import com.concordium.sdk.crypto.bls.BLSSecretKey; | ||
import com.concordium.sdk.responses.blocksummary.updates.queues.AnonymityRevokerInfo; | ||
import com.concordium.sdk.responses.blocksummary.updates.queues.IdentityProviderInfo; | ||
import com.concordium.sdk.responses.cryptographicparameters.CryptographicParameters; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NonNull; | ||
|
||
@Getter | ||
@Builder | ||
public class IdentityRequestInput { | ||
|
||
@NonNull | ||
private final CryptographicParameters globalContext; | ||
|
||
@NonNull | ||
private final Map<String, AnonymityRevokerInfo> arsInfos; | ||
|
||
@NonNull | ||
private final IdentityProviderInfo ipInfo; | ||
|
||
private final long arThreshold; | ||
|
||
@NonNull | ||
private final BLSSecretKey idCredSec; | ||
|
||
@NonNull | ||
private final BLSSecretKey prfKey; | ||
|
||
@NonNull | ||
private final String blindingRandomness; | ||
} |
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
6 changes: 4 additions & 2 deletions
6
...k/src/main/java/com/concordium/sdk/responses/blocksummary/updates/queues/Description.java
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
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.