OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.net; | 5 package org.chromium.net; |
6 | 6 |
7 import android.os.RemoteException; | 7 import android.os.RemoteException; |
8 import android.util.Log; | 8 import android.util.Log; |
9 | 9 |
10 /** | 10 /** |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } | 103 } |
104 | 104 |
105 @Override | 105 @Override |
106 public byte[] getPrivateKeyEncodedBytes(AndroidPrivateKey key) { | 106 public byte[] getPrivateKeyEncodedBytes(AndroidPrivateKey key) { |
107 // This should not be called as it's only for older versions of Android. | 107 // This should not be called as it's only for older versions of Android. |
108 assert false; | 108 assert false; |
109 return null; | 109 return null; |
110 } | 110 } |
111 | 111 |
112 @Override | 112 @Override |
113 public int getOpenSSLHandleForPrivateKey(AndroidPrivateKey privateKey) { | 113 public long getOpenSSLHandleForPrivateKey(AndroidPrivateKey privateKey) { |
114 // This should not be called as it's only for older versions of Android. | 114 // This should not be called as it's only for older versions of Android. |
115 assert false; | 115 assert false; |
116 return 0; | 116 return 0; |
117 } | 117 } |
118 | 118 |
119 public AndroidPrivateKey createKey(String alias) { | 119 public AndroidPrivateKey createKey(String alias) { |
120 try { | 120 try { |
121 int handle = mRemoteManager.getPrivateKeyHandle(alias); | 121 int handle = mRemoteManager.getPrivateKeyHandle(alias); |
122 return new RemotePrivateKey(handle, this); | 122 return new RemotePrivateKey(handle, this); |
123 } catch (RemoteException e) { | 123 } catch (RemoteException e) { |
124 e.printStackTrace(); | 124 e.printStackTrace(); |
125 return null; | 125 return null; |
126 } | 126 } |
127 } | 127 } |
128 | 128 |
129 @Override | 129 @Override |
130 public void releaseKey(AndroidPrivateKey key) { | 130 public void releaseKey(AndroidPrivateKey key) { |
131 RemotePrivateKey remoteKey = (RemotePrivateKey) key; | 131 RemotePrivateKey remoteKey = (RemotePrivateKey) key; |
132 try { | 132 try { |
133 Log.d(TAG, "releaseKey"); | 133 Log.d(TAG, "releaseKey"); |
134 mRemoteManager.releaseKey(remoteKey.getHandle()); | 134 mRemoteManager.releaseKey(remoteKey.getHandle()); |
135 } catch (RemoteException e) { | 135 } catch (RemoteException e) { |
136 e.printStackTrace(); | 136 e.printStackTrace(); |
137 } | 137 } |
138 } | 138 } |
139 } | 139 } |
OLD | NEW |