1 /* 2 * Copyright (C) 2015 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.security.keymaster; 18 19 import android.compat.annotation.UnsupportedAppUsage; 20 import android.os.Build; 21 import android.os.Parcel; 22 import android.os.Parcelable; 23 24 /** 25 * @hide 26 */ 27 public class KeymasterBlob implements Parcelable { 28 public byte[] blob; 29 KeymasterBlob(byte[] blob)30 public KeymasterBlob(byte[] blob) { 31 this.blob = blob; 32 } 33 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) 34 public static final @android.annotation.NonNull Parcelable.Creator<KeymasterBlob> CREATOR = new 35 Parcelable.Creator<KeymasterBlob>() { 36 public KeymasterBlob createFromParcel(Parcel in) { 37 return new KeymasterBlob(in); 38 } 39 40 public KeymasterBlob[] newArray(int length) { 41 return new KeymasterBlob[length]; 42 } 43 }; 44 KeymasterBlob(Parcel in)45 protected KeymasterBlob(Parcel in) { 46 blob = in.createByteArray(); 47 } 48 49 @Override describeContents()50 public int describeContents() { 51 return 0; 52 } 53 54 @Override writeToParcel(Parcel out, int flags)55 public void writeToParcel(Parcel out, int flags) { 56 out.writeByteArray(blob); 57 } 58 } 59