Package com.google.k2crypto

Examples of com.google.k2crypto.Key.buildData()


      throws StoreException {
    assertFalse(driver.isEmpty());
    Key loaded = driver.load();
    assertEquals(
        expected.buildData().build().toByteString(),
        loaded.buildData().build().toByteString());   
  }

  /**
   * Checks that the driver can correctly load, save and erase keys with a
   * simple test sequence. The driver must implement both {@link ReadableDriver}
View Full Code Here


    // Quickly save it (the native driver recognizes file:// addresses)
    storage.save(NATIVE_STORE.toURI(), original);
   
    // 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
View Full Code Here

      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) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.