package at.asitplus.eidas.specific.modules.msproxyservice.utils; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import eu.eidas.auth.commons.light.ILightRequest; /** * Common utils for eIDAS Proxy-Service implementation. * * @author tlenz * */ public class EidasProxyServiceUtils { /** * Check if legal person subject is requested by eIDAS Connector. * * @param eidasRequest Authentication request from eIDAS Connector. * @return true if LegalPersonIdentifier is requested, otherwise falselse */ public static boolean isLegalPersonRequested(ILightRequest eidasRequest) { return eidasRequest.getRequestedAttributes().entrySet().stream() .filter(el -> el.getKey().getFriendlyName().equals(Constants.eIDAS_ATTR_LEGALPERSONIDENTIFIER)) .findFirst() .isPresent(); } /** * Check if natural person subject is requested by eIDAS Connector. * * @param eidasRequest Authentication request from eIDAS Connector. * @return true if PersonIdentifier is requested, otherwise falselse */ public static boolean isNaturalPersonRequested(ILightRequest eidasRequest) { return eidasRequest.getRequestedAttributes().entrySet().stream() .filter(el -> el.getKey().getFriendlyName().equals(Constants.eIDAS_ATTR_PERSONALIDENTIFIER)) .findFirst() .isPresent(); } private EidasProxyServiceUtils() { //hide constructor for class with static methods only } }