package de.ivu.elect.presentation.security;

import javax.enterprise.inject.Specializes;
import javax.inject.Inject;

import de.ivu.elect.business.mandant.entity.Mandant;
import de.ivu.elect.presentation.NlSystemProperties;

@Specializes
public class NlWasPrivatePublicKeyNeeded extends NlPrivatePublicKeyNeeded {

  private static final long serialVersionUID = 1L;

  @Inject
  private transient NlSystemProperties nlSystemProperties;

  @Override
  public boolean isPrivateKeyNeeded(Mandant mandant) {
    return mandant != null && nlSystemProperties.getDefaultElectionLevel(mandant).isPrivateKeyNeeded();
  }

  @Override
  public boolean isPublicKeyNeeded(Mandant mandant) {
    return mandant != null && nlSystemProperties.getDefaultElectionLevel(mandant).isPublicKeyNeeded();
  }
}
