Class InMemoryRegistrationStorage

java.lang.Object
com.jadaptive.webauthn.server.storage.InMemoryRegistrationStorage
All Implemented Interfaces:
com.jadaptive.webauthn.server.storage.RegistrationStorage, com.yubico.webauthn.CredentialRepository

@Component public class InMemoryRegistrationStorage extends Object implements com.jadaptive.webauthn.server.storage.RegistrationStorage
Simple in memory storage implementation.
  • Constructor Details

    • InMemoryRegistrationStorage

      public InMemoryRegistrationStorage()
  • Method Details

    • addRegistrationByUsername

      public boolean addRegistrationByUsername(String username, com.jadaptive.webauthn.server.model.CredentialRegistration reg)
      Specified by:
      addRegistrationByUsername in interface com.jadaptive.webauthn.server.storage.RegistrationStorage
    • getCredentialIdsForUsername

      public Set<com.yubico.webauthn.data.PublicKeyCredentialDescriptor> getCredentialIdsForUsername(String username)
      Specified by:
      getCredentialIdsForUsername in interface com.yubico.webauthn.CredentialRepository
    • getRegistrationsByUsername

      public Collection<com.jadaptive.webauthn.server.model.CredentialRegistration> getRegistrationsByUsername(String username)
      Specified by:
      getRegistrationsByUsername in interface com.jadaptive.webauthn.server.storage.RegistrationStorage
    • getRegistrationsByUserHandle

      public Collection<com.jadaptive.webauthn.server.model.CredentialRegistration> getRegistrationsByUserHandle(com.yubico.webauthn.data.ByteArray userHandle)
      Specified by:
      getRegistrationsByUserHandle in interface com.jadaptive.webauthn.server.storage.RegistrationStorage
    • getUsernameForUserHandle

      public Optional<String> getUsernameForUserHandle(com.yubico.webauthn.data.ByteArray userHandle)
      Specified by:
      getUsernameForUserHandle in interface com.yubico.webauthn.CredentialRepository
    • getUserHandleForUsername

      public Optional<com.yubico.webauthn.data.ByteArray> getUserHandleForUsername(String username)
      Specified by:
      getUserHandleForUsername in interface com.yubico.webauthn.CredentialRepository
    • updateSignatureCount

      public void updateSignatureCount(com.yubico.webauthn.AssertionResult result)
      Specified by:
      updateSignatureCount in interface com.jadaptive.webauthn.server.storage.RegistrationStorage
    • getRegistrationByUsernameAndCredentialId

      public Optional<com.jadaptive.webauthn.server.model.CredentialRegistration> getRegistrationByUsernameAndCredentialId(String username, com.yubico.webauthn.data.ByteArray id)
      Specified by:
      getRegistrationByUsernameAndCredentialId in interface com.jadaptive.webauthn.server.storage.RegistrationStorage
    • removeRegistrationByUsername

      public boolean removeRegistrationByUsername(String username, com.jadaptive.webauthn.server.model.CredentialRegistration credentialRegistration)
      Specified by:
      removeRegistrationByUsername in interface com.jadaptive.webauthn.server.storage.RegistrationStorage
    • removeAllRegistrations

      public boolean removeAllRegistrations(String username)
      Specified by:
      removeAllRegistrations in interface com.jadaptive.webauthn.server.storage.RegistrationStorage
    • lookup

      public Optional<com.yubico.webauthn.RegisteredCredential> lookup(com.yubico.webauthn.data.ByteArray credentialId, com.yubico.webauthn.data.ByteArray userHandle)
      Specified by:
      lookup in interface com.yubico.webauthn.CredentialRepository
    • lookupAll

      public Set<com.yubico.webauthn.RegisteredCredential> lookupAll(com.yubico.webauthn.data.ByteArray credentialId)
      Specified by:
      lookupAll in interface com.yubico.webauthn.CredentialRepository