diff options
Diffstat (limited to 'keystore/java')
-rw-r--r-- | keystore/java/android/security/Keystore.java | 16 | ||||
-rw-r--r-- | keystore/java/android/security/UnsupportedKeyStrengthException.java | 27 |
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); - } -} |