Read/write access to ASN.1-encoded PEM files with optional encryption