All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bccapi.bitlib.crypto.PublicKeyRing Maven / Gradle / Ivy

There is a newer version: 1.0.3
Show newest version
package com.bccapi.bitlib.crypto;

import com.bccapi.bitlib.model.Address;
import com.bccapi.bitlib.model.NetworkParameters;

import java.util.*;

public class PublicKeyRing {
   private List
_addresses; private Set
_addressSet; private Map _publicKeys; public PublicKeyRing() { _addresses = new ArrayList
(); _addressSet = new HashSet
(); _publicKeys = new HashMap(); } /** * Add a public key to the key ring. * * @param key public key * @param network Bitcoin network to talk to */ public void addPublicKey(PublicKey key, NetworkParameters network) { Address address = Address.fromStandardPublicKey(key, network); _addresses.add(address); _addressSet.add(address); _publicKeys.put(address, key); } public PublicKey findPublicKeyByAddress(Address address) { return _publicKeys.get(address); } public List
getAddresses() { return Collections.unmodifiableList(_addresses); } public Set
getAddressSet() { return Collections.unmodifiableSet(_addressSet); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy