Class ApplicationSession<T extends ApplicationSession<T>>

java.lang.Object
com.yubico.yubikit.core.application.ApplicationSession<T>
Type Parameters:
T - the type of the subclass
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
SecurityDomainSession

public abstract class ApplicationSession<T extends ApplicationSession<T>> extends Object implements Closeable
A base class for Sessions with a YubiKey.

Subclasses should use their own type as the parameter T:

class FooSession extends ApplicationSession<FooSession>
  • Constructor Details

    • ApplicationSession

      public ApplicationSession()
  • Method Details

    • getVersion

      public abstract Version getVersion()
      Get the version of the Application from the YubiKey. This is typically the same as the YubiKey firmware, but can be versioned separately as well.
      Returns:
      the Application version
    • supports

      public boolean supports(Feature<T> feature)
      Check if a Feature is supported by the YubiKey.
      Parameters:
      feature - the Feature to check support for.
      Returns:
      true if the Feature is supported, false if not.
    • require

      protected void require(Feature<T> feature)