The 38-year-old could subsequently keep playing for the Italian giants beyond his 40th birthday.
Casillas, three years Buffon's junior, has an option to extend his Porto contract through to 2018 and has no plans to hang up his gloves before his counterpart.
"When he retires, I will too," Casillas, who has won two European Championship medals and a World Cup with Spain, told La Gazzetta dello Sport.
"He just signed a new deal and that makes me happy because that means I will too.
"When we call it quits we'll set up a nice match between my friends and his friends."
Casillas faces competition from David de Gea to claim the gloves for Spain's Euro 2016 opener against Czech Republic on Monday, with the defending champions looking to win the title for a third straight edition.
"It will be more difficult than four years ago. France are good, Belgium are strong and then Germany are world champions. Italy and Portugal are always dangerous."