Verfahren zur Erzeugung einer in physiologischer Umgebung korrosionshemmenden Schicht auf einem Stent oder einem Bestandteil eines Stents, der aus einer Yttrium und weitere Seltenerdmetalle enthaltenden, biokorrodierbaren Magnesiumlegierung besteht und der als medizinisches Implantat oder als ein Bestandteil eines medizinischen Implantats ausgebildet ist, umfassend den Schritt:Behandeln einer Oberfläche des Stents oder des Bestandteil eines Stents mit einer wässrigen, fluoridhaltigen Konversionslösung.A method for the production of a corrosion-inhibiting layer in a physiological environment to a stent, or a part of a stent, which is made of an yttrium and further rem-containing, biocorrodible magnesium alloy and the form of a medical implant or as a component part of a medical implant is formed, comprising the step:Treating a surface of the stent or of the component of a stent with an aqueous, fluoride-containing conversion solution.