Class Carte

java.lang.Object
org.moera.lib.node.carte.Carte

public class Carte extends Object
This class provides functionality for generating and handling a cryptographic "carte". A carte is a signed token-like construct that incorporates specific user, node, and time-related information to ensure security and authenticity.
  • Constructor Details

    • Carte

      public Carte()
  • Method Details

    • getDeadline

      public static Instant getDeadline(Instant beginning)
      Calculates the planned deadline of a carte starting at the given time.
      Parameters:
      beginning - the time from which the deadline will be calculated
      Returns:
      the calculated deadline
    • generate

      public static String generate(String ownerName, InetAddress address, Instant beginning, PrivateKey signingKey, String nodeName, long clientScope, long adminScope)
      Generates a cryptographically signed carte.
      Parameters:
      ownerName - the name of the node authenticating with the carte
      address - if set, the carte is valid for authentication from the given IP address only
      beginning - the beginning time of the carte's life
      signingKey - the private key used to sign the carte
      nodeName - if set, the carte is valid for authentication on the specified node only
      clientScope - the list of permissions granted to the carte
      adminScope - the list of additional administrative permissions (of those granted to the carte's owner by the target node) granted to the carte
      Returns:
      the signed carte