private static Key importRsaKey(String pathname, KeyType type) throws IOException, InvalidKeySpecException {
		try {
			byte[] readBytes = Files.readAllBytes(Paths.get(pathname));
			switch (type) {
			case PRIVATE:
				return KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(readBytes));
			case PUBLIC:
				return KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(readBytes));
			}
		} catch (NoSuchAlgorithmException e) {
			// Should not happen.
			e.printStackTrace();
		}
		return null;
	}