am 653349fe: Merge change 4329 into donut

Merge commit '653349fe48f2995d9e17b5e0a4110925cffdaeab'

* commit '653349fe48f2995d9e17b5e0a4110925cffdaeab':
  Change the first parameter of Keystore.generateKeyPair() to int.
This commit is contained in:
Android (Google) Code Review
2009-06-16 09:07:56 -07:00
committed by The Android Open Source Project
2 changed files with 12 additions and 31 deletions

View File

@@ -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"

View File

@@ -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);
}
}