summaryrefslogtreecommitdiffstats
path: root/keystore/java/android/security
diff options
context:
space:
mode:
authorHung-ying Tyan <tyanh@google.com>2009-06-16 23:51:51 +0800
committerHung-ying Tyan <tyanh@google.com>2009-06-16 23:57:16 +0800
commit396c69ca8d938c8705faf602b87729072bf8839c (patch)
tree3db9a82ce6f79a804091f6037cb55786d6dd9fb5 /keystore/java/android/security
parent1d51e50d5d484c5d9e620b1d6736adc9aa99ae84 (diff)
downloadframeworks_base-396c69ca8d938c8705faf602b87729072bf8839c.zip
frameworks_base-396c69ca8d938c8705faf602b87729072bf8839c.tar.gz
frameworks_base-396c69ca8d938c8705faf602b87729072bf8839c.tar.bz2
Change the first parameter of Keystore.generateKeyPair() to int.
* changes change the parameter to the index to the supported key strengths remove the exception class as it is not useful now
Diffstat (limited to 'keystore/java/android/security')
-rw-r--r--keystore/java/android/security/Keystore.java16
-rw-r--r--keystore/java/android/security/UnsupportedKeyStrengthException.java27
2 files changed, 12 insertions, 31 deletions
diff --git a/keystore/java/android/security/Keystore.java b/keystore/java/android/security/Keystore.java
index 8de20af..71c1cf4 100644
--- a/keystore/java/android/security/Keystore.java
+++ b/keystore/java/android/security/Keystore.java
@@ -48,8 +48,16 @@ public abstract class Keystore {
public abstract String[] getSupportedKeyStrenghs();
- public abstract String generateKeyPair(String keyStrength, String challenge,
- String organizations) throws UnsupportedKeyStrengthException;
+ /**
+ * Generates a key pair and returns the certificate request.
+ * @param keyStrengthIndex index to the array of supported key strengths
+ * @param challenge the challenge message in the keygen tag
+ * @param organizations the organization string, e.g.,
+ * "/C=US/ST={state}/L={city}/O={company}/OU={app}/CN={hostname}"
+ * @return the certificate request
+ */
+ public abstract String generateKeyPair(
+ int keyStrengthIndex, String challenge, String organizations);
public abstract void addCertificate(String cert);
@@ -114,8 +122,8 @@ public abstract class Keystore {
}
@Override
- public String generateKeyPair(String keyStrength, String challenge,
- String organizations) throws UnsupportedKeyStrengthException {
+ public String generateKeyPair(int keyStrengthIndex, String challenge,
+ String organizations) {
// TODO: real implementation
return "-----BEGIN CERTIFICATE REQUEST-----"
+ "\nMIICzjCCAbYCAQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlh"
diff --git a/keystore/java/android/security/UnsupportedKeyStrengthException.java b/keystore/java/android/security/UnsupportedKeyStrengthException.java
deleted file mode 100644
index d0732c2..0000000
--- a/keystore/java/android/security/UnsupportedKeyStrengthException.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security;
-
-/**
- * Thrown when the specified key strength is not supported by the system.
- * {@hide}
- */
-public class UnsupportedKeyStrengthException extends Exception {
- public UnsupportedKeyStrengthException(String msg) {
- super(msg);
- }
-}