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
This commit is contained in:
Hung-ying Tyan
2009-06-16 23:51:51 +08:00
parent 1d51e50d5d
commit 396c69ca8d
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"