No, I know because that’s what I do and I had this fail on me when I migrated to a new phone. I switched to a different app that does backup keys when you use an encrypted iTunes backup.
Edit: oh you wanted to restore on the same device. Well that might work but it doesn’t help when migrating or if your phone is not available.