如何在下面的代码中获取带有编码类型PKI_PATH的certPath obj(输入证书是字符串)

CertificateFactory fact = CertificateFactory.getInstance("X.509");
InputStream stream = new 
ByteArrayInputStream(certificateString.trim().getBytes());
CertPath certPath = fact.generateCertPath(stream, "PkiPath");