You could just use the methods Calibre uses to update the metadata. No need to reinvent the wheel. However, I fail to see why this would be a Good Thing to have. It would only incite people to dig around inside the Calibre library...

Only appeal I can think of is that it would mean that when you open the book using Calibre's viewer you get the same cover appearing that it would have when exported, without doing the EPUB->EPUB conversion? Cosmetic rather than functional?