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:
java.io.Closeable, java.lang.AutoCloseable

public abstract class ApplicationSession<T extends ApplicationSession<T>>
extends java.lang.Object
implements java.io.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 Summary

    Constructors 
    Constructor Description
    ApplicationSession()  
  • Method Summary

    Modifier and Type Method Description
    abstract Version getVersion()
    Get the version of the Application from the YubiKey.
    protected void require​(Feature<T> feature)  
    boolean supports​(Feature<T> feature)
    Check if a Feature is supported by the YubiKey.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.io.Closeable

    close
  • Constructor Details

  • 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)