Class IdentityKeyVerifier
java.lang.Object
org.cloudburstmc.netty.util.nethernet.IdentityKeyVerifier
- All Implemented Interfaces:
AutoCloseable
One login decision, owned by a transport channel. Never exposes admission secrets.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringSpends the binding without a key of its own, for an application's already authenticated and explicitly trusted forwarding path.final voidclose()protected abstract booleanmatches(byte[] canonicalKey) final StringSpends the binding on one login, whatever the outcome.final booleanpending()final booleanrejected()protected abstract voidrelease()Erases whatever the binding held.protected booleanusable()
-
Constructor Details
-
IdentityKeyVerifier
public IdentityKeyVerifier()
-
-
Method Details
-
mismatch
Spends the binding on one login, whatever the outcome.- Parameters:
key- The key the login chain is signed with- Returns:
- Why the login must be rejected, or null when it may proceed
-
acceptForwardedIdentity
Spends the binding without a key of its own, for an application's already authenticated and explicitly trusted forwarding path.- Returns:
- Why the login must be rejected, or null when it may proceed
-
pending
public final boolean pending()- Returns:
- Whether a login may still be decided against this binding
-
rejected
public final boolean rejected()- Returns:
- Whether nothing can be admitted against this binding any more
-
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
usable
protected boolean usable()- Returns:
- Whether the admission behind this binding is still live
-
matches
protected abstract boolean matches(byte[] canonicalKey) - Parameters:
canonicalKey- The login key, canonicalised byIdentityPublicKey- Returns:
- Whether it is the key the transport admitted
-
release
protected abstract void release()Erases whatever the binding held. Called once, whichever way it is spent.
-