Loading Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -238,6 +238,7 @@ LOCAL_SRC_FILES += \ core/java/android/os/IUserManager.aidl \ core/java/android/os/IVibratorService.aidl \ core/java/android/security/IKeystoreService.aidl \ core/java/android/security/keymaster/IKeyAttestationApplicationIdProvider.aidl \ core/java/android/service/carrier/ICarrierService.aidl \ core/java/android/service/carrier/ICarrierMessagingCallback.aidl \ core/java/android/service/carrier/ICarrierMessagingService.aidl \ Loading core/java/android/content/pm/Signature.aidl +21 −9 Original line number Diff line number Diff line Loading @@ -17,4 +17,16 @@ package android.content.pm; parcelable Signature; /* For the key attestation application id provider service we needed a native implementation * of the Signature parcelable because the service is used by the native keystore. * The native implementation is now located at * system/security/keystore/Signature.cpp * and * system/security/keystore/include/keystore/Signature.h. * and can be used by linking against libkeystore_binder. * * This is not the best arrangement. If you, dear reader, happen to implement native implementations * for the package manager's parcelables, consider moving Signature.cpp/.h to your library and * adjust keystore's dependencies accordingly. Thank you. */ parcelable Signature cpp_header "keystore/Signature.h"; core/java/android/security/keymaster/IKeyAttestationApplicationIdProvider.aidl 0 → 100644 +32 −0 Original line number Diff line number Diff line /** * Copyright (c) 2016, 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.keymaster; import android.security.keymaster.KeyAttestationApplicationId; import android.security.keymaster.KeyAttestationPackageInfo; import android.content.pm.Signature; /** * This must be kept manually in sync with system/security/keystore until AIDL * can generate both Java and C++ bindings. * * @hide */ interface IKeyAttestationApplicationIdProvider { /* keep in sync with /system/security/keystore/keystore_attestation_id.cpp */ KeyAttestationApplicationId getKeyAttestationApplicationId(int uid); } core/java/android/security/keymaster/KeyAttestationApplicationId.aidl 0 → 100644 +22 −0 Original line number Diff line number Diff line /* * Copyright (c) 2016, 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.keymaster; /* The cpp_header is relative to system/security/keystore/include * Link against libkeystore_binder to make use of the native implementation of this Parcelable. */ parcelable KeyAttestationApplicationId cpp_header "keystore/KeyAttestationApplicationId.h"; core/java/android/security/keymaster/KeyAttestationApplicationId.java 0 → 100644 +74 −0 Original line number Diff line number Diff line /* * Copyright (C) 2016 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.keymaster; import android.os.Parcel; import android.os.Parcelable; /** * @hide * The information aggregated by this class is used by keystore to identify a caller of the * keystore API toward a remote party. It aggregates multiple PackageInfos because keystore * can only determine a caller by uid granularity, and a uid can be shared by multiple packages. * The remote party must decide if it trusts all of the packages enough to consider the * confidentiality of the key material in question intact. */ public class KeyAttestationApplicationId implements Parcelable { private final KeyAttestationPackageInfo[] mAttestationPackageInfos; /** * @param mAttestationPackageInfos */ public KeyAttestationApplicationId(KeyAttestationPackageInfo[] mAttestationPackageInfos) { super(); this.mAttestationPackageInfos = mAttestationPackageInfos; } /** * @return the mAttestationPackageInfos */ public KeyAttestationPackageInfo[] getAttestationPackageInfos() { return mAttestationPackageInfos; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeTypedArray(mAttestationPackageInfos, flags); } public static final Parcelable.Creator<KeyAttestationApplicationId> CREATOR = new Parcelable.Creator<KeyAttestationApplicationId>() { @Override public KeyAttestationApplicationId createFromParcel(Parcel source) { return new KeyAttestationApplicationId(source); } @Override public KeyAttestationApplicationId[] newArray(int size) { return new KeyAttestationApplicationId[size]; } }; KeyAttestationApplicationId(Parcel source) { mAttestationPackageInfos = source.createTypedArray(KeyAttestationPackageInfo.CREATOR); } } Loading
Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -238,6 +238,7 @@ LOCAL_SRC_FILES += \ core/java/android/os/IUserManager.aidl \ core/java/android/os/IVibratorService.aidl \ core/java/android/security/IKeystoreService.aidl \ core/java/android/security/keymaster/IKeyAttestationApplicationIdProvider.aidl \ core/java/android/service/carrier/ICarrierService.aidl \ core/java/android/service/carrier/ICarrierMessagingCallback.aidl \ core/java/android/service/carrier/ICarrierMessagingService.aidl \ Loading
core/java/android/content/pm/Signature.aidl +21 −9 Original line number Diff line number Diff line Loading @@ -17,4 +17,16 @@ package android.content.pm; parcelable Signature; /* For the key attestation application id provider service we needed a native implementation * of the Signature parcelable because the service is used by the native keystore. * The native implementation is now located at * system/security/keystore/Signature.cpp * and * system/security/keystore/include/keystore/Signature.h. * and can be used by linking against libkeystore_binder. * * This is not the best arrangement. If you, dear reader, happen to implement native implementations * for the package manager's parcelables, consider moving Signature.cpp/.h to your library and * adjust keystore's dependencies accordingly. Thank you. */ parcelable Signature cpp_header "keystore/Signature.h";
core/java/android/security/keymaster/IKeyAttestationApplicationIdProvider.aidl 0 → 100644 +32 −0 Original line number Diff line number Diff line /** * Copyright (c) 2016, 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.keymaster; import android.security.keymaster.KeyAttestationApplicationId; import android.security.keymaster.KeyAttestationPackageInfo; import android.content.pm.Signature; /** * This must be kept manually in sync with system/security/keystore until AIDL * can generate both Java and C++ bindings. * * @hide */ interface IKeyAttestationApplicationIdProvider { /* keep in sync with /system/security/keystore/keystore_attestation_id.cpp */ KeyAttestationApplicationId getKeyAttestationApplicationId(int uid); }
core/java/android/security/keymaster/KeyAttestationApplicationId.aidl 0 → 100644 +22 −0 Original line number Diff line number Diff line /* * Copyright (c) 2016, 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.keymaster; /* The cpp_header is relative to system/security/keystore/include * Link against libkeystore_binder to make use of the native implementation of this Parcelable. */ parcelable KeyAttestationApplicationId cpp_header "keystore/KeyAttestationApplicationId.h";
core/java/android/security/keymaster/KeyAttestationApplicationId.java 0 → 100644 +74 −0 Original line number Diff line number Diff line /* * Copyright (C) 2016 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.keymaster; import android.os.Parcel; import android.os.Parcelable; /** * @hide * The information aggregated by this class is used by keystore to identify a caller of the * keystore API toward a remote party. It aggregates multiple PackageInfos because keystore * can only determine a caller by uid granularity, and a uid can be shared by multiple packages. * The remote party must decide if it trusts all of the packages enough to consider the * confidentiality of the key material in question intact. */ public class KeyAttestationApplicationId implements Parcelable { private final KeyAttestationPackageInfo[] mAttestationPackageInfos; /** * @param mAttestationPackageInfos */ public KeyAttestationApplicationId(KeyAttestationPackageInfo[] mAttestationPackageInfos) { super(); this.mAttestationPackageInfos = mAttestationPackageInfos; } /** * @return the mAttestationPackageInfos */ public KeyAttestationPackageInfo[] getAttestationPackageInfos() { return mAttestationPackageInfos; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeTypedArray(mAttestationPackageInfos, flags); } public static final Parcelable.Creator<KeyAttestationApplicationId> CREATOR = new Parcelable.Creator<KeyAttestationApplicationId>() { @Override public KeyAttestationApplicationId createFromParcel(Parcel source) { return new KeyAttestationApplicationId(source); } @Override public KeyAttestationApplicationId[] newArray(int size) { return new KeyAttestationApplicationId[size]; } }; KeyAttestationApplicationId(Parcel source) { mAttestationPackageInfos = source.createTypedArray(KeyAttestationPackageInfo.CREATOR); } }