
Depending on how the key was stored in Barbican, it may come out of Castellan as a native string, which would not be suitable on Python 3. Now, check that the secret is a byte string, and if it isn't, encode as UTF-8 (to match Barbican's internal encoding). Change-Id: I6da047716c05e4f2a9e1e74ca19afb62e812d172 Closes-Bug: #1847755