Merge change 4329 into donut
* changes: Change the first parameter of Keystore.generateKeyPair() to int.
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user