diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-08-22 09:04:45 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-08-22 09:04:45 +0200 |
commit | e64b4c6f49127c18ccfadcc9d485b5e306f671e8 (patch) | |
tree | 192d8476d54050a5ee6060256901db5c97cf1bf8 /signature-standards/sigs-pades/src | |
parent | 124cfd630280424aea1df428386bcbc6f552acad (diff) | |
download | pdf-as-4-e64b4c6f49127c18ccfadcc9d485b5e306f671e8.tar.gz pdf-as-4-e64b4c6f49127c18ccfadcc9d485b5e306f671e8.tar.bz2 pdf-as-4-e64b4c6f49127c18ccfadcc9d485b5e306f671e8.zip |
better error message when keystore alias is wrong
Diffstat (limited to 'signature-standards/sigs-pades/src')
-rw-r--r-- | signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java index 758e98dd..7772fd3a 100644 --- a/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java +++ b/signature-standards/sigs-pades/src/main/java/at/gv/egiz/pdfas/sigs/pades/PAdESSignerKeystore.java @@ -77,6 +77,9 @@ public class PAdESSignerKeystore implements IPlainSigner { KeyStore ks = KeyStore.getInstance(type); ks.load(new FileInputStream(file), kspassword.toCharArray()); privKey = (PrivateKey) ks.getKey(alias, keypassword.toCharArray()); + if(privKey == null) { + throw new PdfAsException("error.pdf.sig.13"); + } cert = new X509Certificate(ks.getCertificate(alias).getEncoded()); } catch (Throwable e) { throw new PdfAsException("error.pdf.sig.02", e); |