Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: net/android/java/src/org/chromium/net/AndroidKeyStoreRemote.java

Issue 164053004: Refactor AndroidKeyStore to allow remote key handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch to abstract AndroidPrivateKey. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/android/java/src/org/chromium/net/AndroidKeyStoreRemote.java
diff --git a/net/android/java/src/org/chromium/net/AndroidKeyStoreRemote.java b/net/android/java/src/org/chromium/net/AndroidKeyStoreRemote.java
new file mode 100644
index 0000000000000000000000000000000000000000..034465ad788f7ca55d1662c4112b7928f374bb94
--- /dev/null
+++ b/net/android/java/src/org/chromium/net/AndroidKeyStoreRemote.java
@@ -0,0 +1,37 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.net;
+
+/**
+ * TODO(ppi)
+ */
+public abstract class AndroidKeyStoreRemote implements AndroidKeyStore {
+ private static final String TAG = "AndroidKeyStoreRemote";
+
+ protected static class RemotePrivateKey implements AndroidPrivateKey {
+ // Alias of the key on a remote store.
+ final String mHandle;
+ // Key store handling this key.
+ final AndroidKeyStoreRemote mStore;
+
+ RemotePrivateKey(String handle, AndroidKeyStoreRemote store) {
+ mHandle = handle;
+ mStore = store;
+ }
+
+ public String getHandle() {
+ return mHandle;
+ }
+
+ @Override
+ public AndroidKeyStore getKeyStore() {
+ return mStore;
+ }
+ }
+
+ public AndroidPrivateKey createKey(String handle) {
+ return new RemotePrivateKey(handle, this);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698