Open Access is not an infringement on copyright, in fact making your work open access is perfectly legal.
Authors (or their institutions) own the original copyright to their research, but when publishing the original rights holders are often asked to transfer these rights to the publisher, so that the publisher sets the terms for providing open access. OpenAIRE encourages researchers to choose publishers who let them retain their author rights, so that immediate access can be provided. Ideally, an open license is applied to the work, so that access and reuse rights are clearly defined for every end-user. Creative Commons (such as CC BY 4.0 for publications and CC0 for data) or GNU (for software and code) are very suitable for this purpose. If the publisher does not standardly allow you to retain your rights, please consider negotiating this using with an addendum to the publication agreement.
Some publishers of Open Access journals ask for a transfer of copyrights but still provide immediate open access via the journal home page. If you have transferred your rights to the publisher and the article is published in a closed access journal but you still want to provide open access, you can do this through self-archiving. Sherpa/RoMEO offers a journal-by-journal overview of publisher self-archiving policies.