Package org.moera.lib.node.carte
Class Carte
java.lang.Object
org.moera.lib.node.carte.Carte
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
generate
(String ownerName, InetAddress address, Instant beginning, PrivateKey signingKey, String nodeName, long clientScope, long adminScope) Generates a cryptographically signed carte.static Instant
getDeadline
(Instant beginning) Calculates the planned deadline of a carte starting at the given time.
-
Constructor Details
-
Carte
public Carte()
-
-
Method Details
-
getDeadline
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 carteaddress
- if set, the carte is valid for authentication from the given IP address onlybeginning
- the beginning time of the carte's lifesigningKey
- the private key used to sign the cartenodeName
- if set, the carte is valid for authentication on the specified node onlyclientScope
- the list of permissions granted to the carteadminScope
- 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
-