simplify x509 material loading

address #1