package de.ivu.elect.business.security.control;

import java.io.Serializable;
import java.util.List;

import javax.inject.Inject;

import de.ivu.elect.jee.security.PasswordEncryptionService;
import de.ivu.elect.jee.security.PasswordEncryptionServiceSHA1;
import de.ivu.elect.jee.security.PasswordEncryptionServiceSHA512;


import static java.util.Arrays.asList;

public class PasswordEncryptionServiceFinder implements Serializable {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient PasswordEncryptionServiceSHA512 passwordEncryptionServiceSHA512;

  @Inject
  private transient PasswordEncryptionServiceSHA1 passwordEncryptionServiceSHA1;

  public PasswordEncryptionService getDefaultPasswordEncryptionService() {
    return passwordEncryptionServiceSHA512;
  }

  public List<PasswordEncryptionService> gteFallbackPasswordEncryptionServices() {
    return asList(passwordEncryptionServiceSHA1);
  }
}
