Added pkey serialization (untested) and started to implement x509