Class FIDO2RegistrationHelper


  • public class FIDO2RegistrationHelper
    extends java.lang.Object
    Work with a users FIDO registrations. Example usage:
    
     var registrationHelper = new FIDO2RegistrationHelper();
    
     var registrations = registrationHelper.getRegistrationsByUsername(username);
    
     for(var i = 0; i < registrations; i++) {
      var registration = registrations[i];
      // Work with the registration
     }
     
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FIDO2Registration getRegistrationByCredId​(java.lang.String credentialId)
      Retrieve a registration for a given credential Id.
      java.util.List<FIDO2Registration> getRegistrationsByUid​(java.lang.String rpId, java.lang.String uid)
      Retrieve a registration for a given FIDO User Id.
      java.util.List<FIDO2Registration> getRegistrationsByUsername​(java.lang.String username)
      get registrations for a given Verify Access username
      boolean removeRegistration​(java.lang.String credentialId)
      Remove the registration for a particular credentialId
      boolean removeRegistration​(java.lang.String rpId, java.lang.String credentialId)
      Remove the registration for a particular credentialId and relying party ID.
      void updateNickname​(java.lang.String credentialId, java.lang.String nickname)
      Method updates the friendly name for Registration referenced by the given credential ID.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FIDO2RegistrationHelper

        public FIDO2RegistrationHelper()
    • Method Detail

      • getRegistrationByCredId

        public FIDO2Registration getRegistrationByCredId​(java.lang.String credentialId)
                                                  throws Fido2PersistenceException
        Retrieve a registration for a given credential Id.
        Parameters:
        credentialId - as returned from the authenticator.
        Returns:
        the registration as native JSON.
        Throws:
        Fido2PersistenceException
      • getRegistrationsByUid

        public java.util.List<FIDO2Registration> getRegistrationsByUid​(java.lang.String rpId,
                                                                       java.lang.String uid)
                                                                throws Fido2PersistenceException
        Retrieve a registration for a given FIDO User Id.
        Parameters:
        Uid - as generated assigned to a user.
        Returns:
        the registration as native JSON.
        Throws:
        Fido2PersistenceException
      • getRegistrationsByUsername

        public java.util.List<FIDO2Registration> getRegistrationsByUsername​(java.lang.String username)
                                                                     throws Fido2PersistenceException
        get registrations for a given Verify Access username
        Parameters:
        username - of the registrations to lookup return array of registrations, as native JSON.
        Throws:
        Fido2PersistenceException
      • removeRegistration

        public boolean removeRegistration​(java.lang.String rpId,
                                          java.lang.String credentialId)
                                   throws Fido2PersistenceException
        Remove the registration for a particular credentialId and relying party ID.
        Parameters:
        rpId - which the registration belonged to
        credentialId - to remove
        Returns:
        true: a registration was deleted / false : no registration deleted
        Throws:
        Fido2PersistenceException
      • removeRegistration

        public boolean removeRegistration​(java.lang.String credentialId)
                                   throws Fido2PersistenceException
        Remove the registration for a particular credentialId
        Parameters:
        credentialId - to remove
        Returns:
        true: a registration was deleted / false : no registration deleted
        Throws:
        Fido2PersistenceException
      • updateNickname

        public void updateNickname​(java.lang.String credentialId,
                                   java.lang.String nickname)
                            throws Fido2PersistenceException
        Method updates the friendly name for Registration referenced by the given credential ID.
        Parameters:
        credentialId - The credential ID for the Registration to update.
        nickname - The new friendly name.
        Throws:
        Fido2PersistenceException