public static SecretKey generateKey(String algorithm, KeySpec keySpec) {
		final SecretKeyFactory keyFactory = getSecretKeyFactory(algorithm);
		try {
			return keyFactory.generateSecret(keySpec);
		} catch (InvalidKeySpecException e) {
			throw new CryptoException(e);
		}
	}
public static SecretKey generateKey ( String algorithm , KeySpec keySpec ) { final SecretKeyFactory keyFactory = getSecretKeyFactory ( algorithm ) ; try { return keyFactory . generateSecret ( keySpec ) ; } catch ( InvalidKeySpecException e ) { throw new CryptoException ( e ) ; } }
生成 {@link SecretKey}，仅用于对称加密和摘要算法

@param algorithm 算法
@param keySpec {@link KeySpec}
@return {@link SecretKey}