0

我有简单的方法 getSigner ,它返回新的签名者(XadesSigner 对象)。相同的方法适用于简单的控制台 java 应用程序,但在 Android 中会抛出 XadesProfileResolutiionException。有人帮我吗?

private XadesSigner getSigner(String pfxPath, String password) throws SigningKeyException {

    try {
        KeyingDataProvider keyingProvider = getKeyingDataProvider(pfxPath, password);
        XadesSigningProfile p = new XadesBesSigningProfile(keyingProvider);
        return p.newSigner();

    } catch (KeyStoreException ex) {
        throw new SigningKeyException("Keystore Problem", ex);
    } catch (SigningCertChainException ex) {
        throw new SigningKeyException("Signer Cert Chain Problem", ex);
    } catch (UnexpectedJCAException ex) {
        throw new SigningKeyException("JCA Problem", ex);
    } catch (XadesProfileResolutionException ex) {
        throw new SigningKeyException("XadesProfileResolutionException Problem", ex);
    }
}
4

0 回答 0