Remove duplicated code

Create new function to indicate version of encrypted file container to
remove duplicated code.

The version has been bumped to "pending" xx while a decision is made on
how to handle different versions where backwards compatibility isn't
broken.