Package com.google.k2crypto.storage

Examples of com.google.k2crypto.storage.Store


    // Quickly load it back
    Key loaded = storage.load(NATIVE_STORE.toURI());
    assert(original.buildData().build().equals(loaded.buildData().build()));
   
    // Use Store API for more elaborate operations
    Store store = null;
    try {
      // Open a SQLite database store
      store = storage.open(
          "sqlite:" + SQLITE_DATABASE.toURI().getRawPath() + "#samekey");
     
      // Save previously loaded key
      store.save(loaded);
     
      // Check store is not empty and load key back
      if (!store.isEmpty()) {
        Key sameKey = store.load();
        assert(loaded.buildData().build().equals(sameKey.buildData().build()));
      }
     
    } finally {
      // Close store
      if (store != null) {
        store.close();
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.google.k2crypto.storage.Store

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.