创建新的Signer抛出XadesProfileResolutionException [Android Xades4j]

时间:2018-05-17 13:03:10

标签: android exception xades4j signer

我有一个简单的方法getSigner,它返回新的Signer(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);
    }
}

0 个答案:

没有答案