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

Commit 1d38f589 authored by Zoltan Szatmary-Ban's avatar Zoltan Szatmary-Ban Committed by Android (Google) Code Review
Browse files

Merge "Extend IKeyChainService AIDL with CACert retrieval" into lmp-dev

parents eea87a3a f0ae1350
Loading
Loading
Loading
Loading
+52 −0
Original line number Diff line number Diff line
/*
 * Copyright 2014, 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 com.android.internal.util;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Helper class to adapt a simple String to cases where a Parcelable is expected.
 * @hide
 */
public class ParcelableString implements Parcelable {
    public String string;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeString(string);
    }

    public static final Parcelable.Creator<ParcelableString> CREATOR =
            new Parcelable.Creator<ParcelableString>() {
                @Override
                public ParcelableString createFromParcel(Parcel in) {
                    ParcelableString ret = new ParcelableString();
                    ret.string = in.readString();
                    return ret;
                }
                @Override
                public ParcelableString[] newArray(int size) {
                    return new ParcelableString[size];
                }
    };
}
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
 */
package android.security;

import android.content.pm.ParceledListSlice;

/**
 * Caller is required to ensure that {@link KeyStore#unlock
 * KeyStore.unlock} was successful.
@@ -32,6 +34,11 @@ interface IKeyChainService {
    // APIs used by Settings
    boolean deleteCaCertificate(String alias);
    boolean reset();
    ParceledListSlice getUserCaAliases();
    ParceledListSlice getSystemCaAliases();
    boolean containsCaAlias(String alias);
    byte[] getEncodedCaCertificate(String alias, boolean includeDeletedSystem);
    List<String> getCaCertificateChainAliases(String rootAlias, boolean includeDeletedSystem);

    // APIs used by KeyChainActivity
    void setGrant(int uid, String alias, boolean value);
+2 −1
Original line number Diff line number Diff line
@@ -397,7 +397,8 @@ public final class KeyChain {
        return KeyStore.getInstance().isHardwareBacked(algorithm);
    }

    private static X509Certificate toCertificate(byte[] bytes) {
    /** @hide */
    public static X509Certificate toCertificate(byte[] bytes) {
        if (bytes == null) {
            throw new IllegalArgumentException("bytes == null");
        }