Here you can find the source of aesStoreKeyToFile(Key secretKey, String path)
private static void aesStoreKeyToFile(Key secretKey, String path)
//package com.java2s; //License from project: Open Source License import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.security.Key; public class Main { private static void aesStoreKeyToFile(Key secretKey, String path) { try {/*from www. j a v a2s . com*/ Path store = Paths.get(path); Files.write(store, secretKey.getEncoded()); } catch (Exception e) { e.printStackTrace(); } } }