congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
KeyAddress.isMatchingKeyAddress
Code IndexAdd Tabnine to your IDE (free)

How to use
isMatchingKeyAddress
method
in
com.icodici.crypto.KeyAddress

Best Java code snippets using com.icodici.crypto.KeyAddress.isMatchingKeyAddress (Showing top 6 results out of 315)

origin: UniversaBlockchain/universa

public boolean isMatchingAddress(KeyAddress address) {
  for (KeyAddress addr: unsAddresses)
    if (addr.isMatchingKeyAddress(address))
      return true;
  return false;
}
origin: UniversaBlockchain/universa

@Override
public final boolean isMatchingKeyAddress(KeyAddress other) {
  return other.isLong() ?
      getLongAddress().isMatchingKeyAddress(other) : getShortAddress().isMatchingKeyAddress(other);
}
origin: UniversaBlockchain/universa

@Override
public boolean isMatchingKey(AbstractKey key) {
  return getShortAddress().isMatchingKeyAddress(key.getShortAddress());
}
origin: UniversaBlockchain/universa

/**
 * Check that the address matches role.
 *
 * @param keyAddress address for matching with role
 * @return true if match or false
 * @deprecated the only usable check allowance method is isAllowedForKeys
 */
@Deprecated
public boolean isMatchingKeyAddress(KeyAddress keyAddress) {
  for (KeyAddress ka : this.getKeyAddresses()) {
    if (keyAddress.isMatchingKeyAddress(ka))
      return true;
  }
  for (PublicKey pk : this.getKeys()) {
    if (keyAddress.isMatchingKey(pk))
      return true;
  }
  return false;
}
/**
origin: UniversaBlockchain/universa

private void testMatch(boolean use384) throws KeyAddress.IllegalAddressException {
  KeyAddress a = key1.address(use384, 7);
  KeyAddress b = new KeyAddress(a.toString());
  assertEquals(7, b.getTypeMark());
  assertEquals(7, a.getTypeMark());
  assertTrue(b.isMatchingKey(key1));
  assertTrue(a.isMatchingKeyAddress(b));
  assertTrue(b.isMatchingKeyAddress(a));
  assertTrue(key1.isMatchingKey(key1));
  assertTrue(key1.isMatchingKeyAddress(a));
  assertTrue(key1.isMatchingKeyAddress(b));
  byte[] pack = a.getPacked();
  pack[7] ^= 71;
  try {
    new KeyAddress(pack);
    fail("must throw error on spoiled address");
  }
  catch(KeyAddress.IllegalAddressException e) {
  }
}
origin: UniversaBlockchain/universa

  @Test
  public void serialize() throws IOException {
    KeyAddress a = key1.address(true, 8);
    KeyAddress b = key1.address(false, 9);
    Boss.Reader r = new Boss.Reader(Boss.dump(a,b).toArray());
    KeyAddress x = r.read();
    KeyAddress y = r.read();
    assertEquals(8, x.getTypeMark());
    assertEquals(9, y.getTypeMark());
    assertTrue(x.isMatchingKey(key1));
    assertTrue(y.isMatchingKeyAddress(b));
  }
}
com.icodici.cryptoKeyAddressisMatchingKeyAddress

Javadoc

Check that the address matches key information. It DOES NOT check the typeMark #getTypeMark()! If the type mark is important, check it by hand. If teh address sizes are different always retuen false, in this case it is not possible to perform the real check.

Popular methods of KeyAddress

  • <init>
    Unpack an address. After construction, use #getTypeMark() and #isMatchingKey(AbstractKey) methods to
  • toString
    Get the packed string representaion. Uses Safe58 to encode data provided by the #getPacked()
  • isMatchingKey
    Check that the key matches this address, e.g. has of the same type and the digest of its components
  • getPacked
  • isLong
  • equals
  • getBiAdapter
  • getTypeMark
  • mask
    Each supported key has a mask that represents its type. The key that has no known mask can't be proc

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • findViewById (Activity)
  • setScale (BigDecimal)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now