package at.asitplus.eidas.specific.proxy.builder; import at.asitplus.eidas.specific.core.builder.AuthenticationDataBuilder; import at.gv.egiz.eaaf.core.api.data.EaafConstants; import lombok.extern.slf4j.Slf4j; /** * eIDAS Proxy-Service specific authentication-data builder. * * @author tlenz * */ @Slf4j public class ProxyAuthenticationDataBuilder extends AuthenticationDataBuilder { private static final String PLUS = "+"; @Override protected String customizeLegalPersonSourcePin(String sourcePin, String sourcePinType) { String sectorType = sourcePinType.substring((EaafConstants.URN_PREFIX_BASEID + PLUS).length()); return sectorType + PLUS + sourcePin; } @Override protected String customizeBpkAttribute(String pvpBpkAttrValue) { final String[] split = pvpBpkAttrValue.split(":", 2); if (split.length == 2) { log.debug("Remove prefix from bPK attribute to transform it into eIDAS-Node format"); return split[1]; } else { log.warn("PVP bPK attribute: {} has wrong format. Use it as it is.", pvpBpkAttrValue); return pvpBpkAttrValue; } } }