Support writing needed extension types

Why these changes?  Looks like you just pulled out a public key to never use it.