All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ee.sk.smartid.CertificateLevel Maven / Gradle / Ivy

Go to download

Smart-ID Java client is a Java library that can be used for easy integration of the Smart-ID solution to information systems or e-services

There is a newer version: 2.3
Show newest version
package ee.sk.smartid;

import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;

public class CertificateLevel {

  private String certificateLevel;

  private static final Map certificateLevels = new HashMap<>();

  static {
    certificateLevels.put("ADVANCED", 1);
    certificateLevels.put("QUALIFIED", 2);
  }

  public CertificateLevel(String certificateLevel) {
    this.certificateLevel = certificateLevel;
  }

  public boolean isEqualOrAbove(String certificateLevel) {
    if (StringUtils.equalsIgnoreCase(this.certificateLevel, certificateLevel)) {
      return true;
    } else if (certificateLevels.get(certificateLevel) != null && certificateLevels.get(this.certificateLevel) != null) {
      return certificateLevels.get(certificateLevel) <= certificateLevels.get(this.certificateLevel);
    }
    return false;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy