Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d638d8d6 authored by Android (Google) Code Review's avatar Android (Google) Code Review Committed by The Android Open Source Project
Browse files

am 653349fe: Merge change 4329 into donut

Merge commit '653349fe'

* commit '653349fe':
  Change the first parameter of Keystore.generateKeyPair() to int.
parents a877427e 653349fe
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -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"
+0 −27
Original line number Diff line number Diff line
/*
 * 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);
    }
}