Package com.google.k2crypto

Examples of com.google.k2crypto.K2Context


   * Creates a new context for initializing drivers.
   *
   * <p>The context will have all necessary key versions registered.
   */
  protected K2Context newContext() {
    K2Context context = new K2Context();
    try {
      context.getKeyVersionRegistry().register(MockKeyVersion.class);
    } catch (KeyVersionException ex) {
      throw new AssertionError("Could not register mock.", ex);
    }
    return context;
  }
View Full Code Here


  /**
   * Creates the mock driver (and other objects) that will be passed to the
   * store for testing.
   */
  @Before public final void setUp() throws K2Exception {
    context = new K2Context();
    normalDriver = new InstalledDriver(context, MockDriver.Normal.class);
   
    // TODO(darylseah): We need a proper way to create keys for testing.
    //                  The current approach is fragile and WILL break later.
    saveKey = new Key();
View Full Code Here

  /**
   * Creates a context for the tests.
   */
  @Before public final void setUp() {
    context = new K2Context();
  }
View Full Code Here

  /**
   * Creates a context for the tests.
   */
  @Before public final void setUp() {
    context = new K2Context();
  }
View Full Code Here

  /**
   * Creates a context for the tests.
   */
  @Before public final void setUp() {
    context = new K2Context();
  }
View Full Code Here

    SQLITE_DATABASE.delete();
    NATIVE_STORE.deleteOnExit();
    SQLITE_DATABASE.deleteOnExit();

    // Initialize context and storage system
    K2Context context = new K2Context();
    K2Storage storage = new K2Storage(context);
   
    // Register available key versions
    KeyVersionRegistry registry = context.getKeyVersionRegistry();
    try {
      registry.register(AESKeyVersion.class);
      registry.register(HMACKeyVersion.class);
    } catch (KeyVersionException ex) {
      // Something wrong with a key version
View Full Code Here

  /**
   * Creates a context for the tests.
   */
  @Before public final void setUp() {
    context = new K2Context();
  }
View Full Code Here

TOP

Related Classes of com.google.k2crypto.K2Context

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.