Skip to content

stuinzuri/SimpleJavaKeyStore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleJavaKeyStore

Travis CI: Build Status

A simple Java key store from a StackOverflow answer to Easy way to store/restore encryption key for decrypting string in java.

I'm a fan of static utility functions and static imports.

import static ch.geekomatic.sjks.KeyStoreUtils.generateKey;
import static ch.geekomatic.sjks.KeyStoreUtils.loadKey;
import static ch.geekomatic.sjks.KeyStoreUtils.saveKey;

Generating a key:

SecretKey originalKey = generateKey();

Saving a key:

File file = new File("/path/to/key.file");
saveKey(originalKey, file);

Loading a key:

File file = new File("/path/to/key.file");
SecretKey persistedKey = loadKey(file);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages