com.quorum.tessera.partyinfo.PartyInfoServiceUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tessera-partyinfo Show documentation
Show all versions of tessera-partyinfo Show documentation
Tessera is a stateless Java system that is used to enable the encryption, decryption, and distribution of private transactions for Quorum.
package com.quorum.tessera.partyinfo;
import com.quorum.tessera.encryption.PublicKey;
import com.quorum.tessera.partyinfo.node.NodeInfo;
import com.quorum.tessera.partyinfo.node.Recipient;
import java.util.Map;
import java.util.stream.Collectors;
public interface PartyInfoServiceUtil {
static boolean validateKeysToUrls(final NodeInfo existingPartyInfo, final NodeInfo newPartyInfo) {
final Map existingRecipientKeyUrlMap =
existingPartyInfo.getRecipients().stream()
.collect(Collectors.toMap(Recipient::getKey, Recipient::getUrl));
final Map newRecipientKeyUrlMap =
newPartyInfo.getRecipients().stream().collect(Collectors.toMap(Recipient::getKey, Recipient::getUrl));
for (final Map.Entry entry : newRecipientKeyUrlMap.entrySet()) {
final PublicKey key = entry.getKey();
if (existingRecipientKeyUrlMap.containsKey(key)) {
String existingUrl = existingRecipientKeyUrlMap.get(key);
String newUrl = entry.getValue();
if (!existingUrl.equalsIgnoreCase(newUrl)) {
return false;
}
}
}
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy