Class FamilyKeyCrypto

java.lang.Object
net.i2p.router.crypto.FamilyKeyCrypto

public class FamilyKeyCrypto extends Object
Utilities for creating, storing, retrieving the signing keys for the netdb family feature
Since:
0.9.24
  • Field Details

  • Constructor Details

  • Method Details

    • shutdown

      public void shutdown()
      Clears the caches
    • sign

      public Map<String,String> sign(String family, Hash h) throws GeneralSecurityException
      Caller must add family to RI also. throws on all errors
      Parameters:
      family - non-null, must match that we were initialized with or will throw GSE
      h - non-null
      Returns:
      non-null options to be added to the RI
      Throws:
      GeneralSecurityException - on null hash, null or changed family, or signing error
    • hasFamily

      public boolean hasFamily()
      Do we have a valid family?
      Since:
      0.9.28
    • getOurFamily

      public Set<Hash> getOurFamily()
      Get verified members of our family. Will not contain ourselves.
      Returns:
      non-null, not a copy, do not modify
      Since:
      0.9.28
    • getOurFamilyName

      public String getOurFamilyName()
      Get our family name.
      Returns:
      name or null
      Since:
      0.9.28
    • verify

      public FamilyKeyCrypto.Result verify(RouterInfo ri)
      Verify the family signature in a RouterInfo. This requires a family key in the RI, or a certificate file for the family in certificates/family.
      Returns:
      Result
    • verifyOurFamily

      public boolean verifyOurFamily(RouterInfo ri)
      Verify the family in a RouterInfo matches ours and the signature is good. Returns false if we don't have a family and sig, or they don't. Returns false for ourselves.
      Returns:
      true if family matches with good sig
      Since:
      0.9.28
    • main

      public static void main(String[] args)
      Since:
      0.9.36