Search in sources :

Example 1 with ProfileKeyCredentialPresentation

use of org.signal.zkgroup.profiles.ProfileKeyCredentialPresentation in project Signal-Android by WhisperSystems.

the class GroupsV2Operations_decrypt_change_Test method groupCandidate.

GroupCandidate groupCandidate(UUID uuid, ProfileKey profileKey) {
    try {
        ClientZkProfileOperations profileOperations = clientZkOperations.getProfileOperations();
        ProfileKeyCommitment commitment = profileKey.getCommitment(uuid);
        ProfileKeyCredentialRequestContext requestContext = profileOperations.createProfileKeyCredentialRequestContext(uuid, profileKey);
        ProfileKeyCredentialRequest request = requestContext.getRequest();
        ProfileKeyCredentialResponse profileKeyCredentialResponse = server.getProfileKeyCredentialResponse(request, uuid, commitment);
        ProfileKeyCredential profileKeyCredential = profileOperations.receiveProfileKeyCredential(requestContext, profileKeyCredentialResponse);
        GroupCandidate groupCandidate = new GroupCandidate(uuid, Optional.of(profileKeyCredential));
        ProfileKeyCredentialPresentation presentation = profileOperations.createProfileKeyCredentialPresentation(groupSecretParams, profileKeyCredential);
        server.assertProfileKeyCredentialPresentation(groupSecretParams.getPublicParams(), presentation);
        return groupCandidate;
    } catch (VerificationFailedException e) {
        throw new AssertionError(e);
    }
}
Also used : ProfileKeyCredentialResponse(org.signal.zkgroup.profiles.ProfileKeyCredentialResponse) ProfileKeyCredential(org.signal.zkgroup.profiles.ProfileKeyCredential) ClientZkProfileOperations(org.signal.zkgroup.profiles.ClientZkProfileOperations) ProfileKeyCredentialRequest(org.signal.zkgroup.profiles.ProfileKeyCredentialRequest) ProfileKeyCredentialPresentation(org.signal.zkgroup.profiles.ProfileKeyCredentialPresentation) ProfileKeyCommitment(org.signal.zkgroup.profiles.ProfileKeyCommitment) ProfileKeyCredentialRequestContext(org.signal.zkgroup.profiles.ProfileKeyCredentialRequestContext) VerificationFailedException(org.signal.zkgroup.VerificationFailedException)

Aggregations

VerificationFailedException (org.signal.zkgroup.VerificationFailedException)1 ClientZkProfileOperations (org.signal.zkgroup.profiles.ClientZkProfileOperations)1 ProfileKeyCommitment (org.signal.zkgroup.profiles.ProfileKeyCommitment)1 ProfileKeyCredential (org.signal.zkgroup.profiles.ProfileKeyCredential)1 ProfileKeyCredentialPresentation (org.signal.zkgroup.profiles.ProfileKeyCredentialPresentation)1 ProfileKeyCredentialRequest (org.signal.zkgroup.profiles.ProfileKeyCredentialRequest)1 ProfileKeyCredentialRequestContext (org.signal.zkgroup.profiles.ProfileKeyCredentialRequestContext)1 ProfileKeyCredentialResponse (org.signal.zkgroup.profiles.ProfileKeyCredentialResponse)1