Support writing needed extension types

It's used below. The Authority Key Identifier extensions needs the CA's public key.