public static PrivateKey getSignCertPrivateKeyByStoreMap(String certPath,
			String certPwd) {
		if (!keyStoreMap.containsKey(certPath)) {
			loadSignCert(certPath, certPwd);
		}
		try {
			Enumeration<String> aliasenum = keyStoreMap.get(certPath)
					.aliases();
			String keyAlias = null;
			if (aliasenum.hasMoreElements()) {
				keyAlias = aliasenum.nextElement();
			}
			PrivateKey privateKey = (PrivateKey) keyStoreMap.get(certPath)
					.getKey(keyAlias, certPwd.toCharArray());
			return privateKey;
		} catch (KeyStoreException e) {
			LogUtil.writeErrorLog("getSignCertPrivateKeyByStoreMap Error", e);
			return null;
		} catch (UnrecoverableKeyException e) {
			LogUtil.writeErrorLog("getSignCertPrivateKeyByStoreMap Error", e);
			return null;
		} catch (NoSuchAlgorithmException e) {
			LogUtil.writeErrorLog("getSignCertPrivateKeyByStoreMap Error", e);
			return null;
		}
	}
public static PrivateKey getSignCertPrivateKeyByStoreMap ( String certPath , String certPwd ) { if ( ! keyStoreMap . containsKey ( certPath ) ) { loadSignCert ( certPath , certPwd ) ; } try { Enumeration < String > aliasenum = keyStoreMap . get ( certPath ) . aliases ( ) ; String keyAlias = null ; if ( aliasenum . hasMoreElements ( ) ) { keyAlias = aliasenum . nextElement ( ) ; } PrivateKey privateKey = ( PrivateKey ) keyStoreMap . get ( certPath ) . getKey ( keyAlias , certPwd . toCharArray ( ) ) ; return privateKey ; } catch ( KeyStoreException e ) { LogUtil . writeErrorLog ( "getSignCertPrivateKeyByStoreMap Error" , e ) ; return null ; } catch ( UnrecoverableKeyException e ) { LogUtil . writeErrorLog ( "getSignCertPrivateKeyByStoreMap Error" , e ) ; return null ; } catch ( NoSuchAlgorithmException e ) { LogUtil . writeErrorLog ( "getSignCertPrivateKeyByStoreMap Error" , e ) ; return null ; } }
通过指定路径的私钥证书  获取PrivateKey对象

@return