class HubIdentityProviderMetadataDtoToEntityDescriptorTransformer implements Function<HubIdentityProviderMetadataDto,EntityDescriptor> {

    @Override
    public EntityDescriptor apply(HubIdentityProviderMetadataDto dto) {
        final EntityDescriptor entityDescriptor = doTransform(dto);

        final List<KeyDescriptor> keyDescriptors = entityDescriptor.getIDPSSODescriptor(SAMLConstants.SAML20P_NS).getKeyDescriptors();
        keyDescriptors.addAll(getKeyDescriptorsUnmarshaller().fromCertificates(dto.getIdpSigningCertificates()));
        keyDescriptors.addAll(getKeyDescriptorsUnmarshaller().fromCertificates(dto.getEncryptionCertificates()));


        return entityDescriptor;
    }

    public  HubIdentityProviderMetadataDtoToEntityDescriptorTransformer(
        OpenSamlXmlObjectFactory openSamlXmlObjectFactory,
        KeyDescriptorsUnmarshaller keyDescriptorsUnmarshaller,
        IdGenerator idGenerator);

}