|
From: Bob K. <bob...@us...> - 2004-10-25 02:58:56
|
Update of /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13731/src/hk/hku/cecid/phoenix/message/packaging Modified Files: PKISignatureImpl.java Log Message: Fix the bug on NullPointerException when invalid keystore is set during signing. Replace with throwing the message starts with "Cannot get private key" Index: PKISignatureImpl.java =================================================================== RCS file: /cvsroot/ebxmlms/ebxmlms/src/hk/hku/cecid/phoenix/message/packaging/PKISignatureImpl.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PKISignatureImpl.java 21 Apr 2004 06:25:51 -0000 1.17 --- PKISignatureImpl.java 25 Oct 2004 02:58:47 -0000 1.18 *************** *** 114,117 **** --- 114,119 ---- private final EbxmlMessage ebxmlMessage; + private static final String CANNOT_GET_PRIVATE_KEY + = "Cannot get private key"; PKISignatureImpl(EbxmlMessage ebxmlMessage) throws SOAPException { *************** *** 188,196 **** } catch (Exception e) { ! String err = "Cannot get private key: " + alias + " - " + e.getMessage(); logger.warn(err); throw new SignException(err); } if (algo != null) { --- 190,203 ---- } catch (Exception e) { ! String err = CANNOT_GET_PRIVATE_KEY + " : " + alias + " - " + e.getMessage(); logger.warn(err); throw new SignException(err); } + if (pk == null) { + String err = CANNOT_GET_PRIVATE_KEY + " : " + alias; + logger.warn(err); + throw new SignException(err); + } if (algo != null) { |