用 PHP 实现 SHA1withDSA 签名是否成功?此处报告失败。
PKCS8EncodedKeySpec prvSpec = new PKCS8EncodedKeySpec(prvKeyBytes);
KeyFactory keyFactory = KeyFactory.getInstance("DSA");
PrivateKey prvKey = keyFactory.generatePrivate(prvSpec);
Signature sig = Signature.getInstance("SHA1withDSA");
sig.initSign(prvKey);
sig.update(text);
byte[] result = sig.sign();