Alex Klyubin | 8effa36 | 2015-06-24 16:06:55 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
Chad Brubaker | 5e73c0e | 2015-03-21 22:46:43 -0700 | [diff] [blame] | 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 | * |
Alex Klyubin | 8effa36 | 2015-06-24 16:06:55 -0700 | [diff] [blame] | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
Chad Brubaker | 5e73c0e | 2015-03-21 22:46:43 -0700 | [diff] [blame] | 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.os.Parcel; |
| 20 | import android.os.Parcelable; |
| 21 | |
| 22 | /** |
| 23 | * @hide |
| 24 | */ |
| 25 | public class KeymasterBlob implements Parcelable { |
| 26 | public byte[] blob; |
| 27 | |
| 28 | public KeymasterBlob(byte[] blob) { |
| 29 | this.blob = blob; |
| 30 | } |
| 31 | public static final Parcelable.Creator<KeymasterBlob> CREATOR = new |
| 32 | Parcelable.Creator<KeymasterBlob>() { |
| 33 | public KeymasterBlob createFromParcel(Parcel in) { |
| 34 | return new KeymasterBlob(in); |
| 35 | } |
| 36 | |
| 37 | public KeymasterBlob[] newArray(int length) { |
| 38 | return new KeymasterBlob[length]; |
| 39 | } |
| 40 | }; |
| 41 | |
| 42 | protected KeymasterBlob(Parcel in) { |
| 43 | blob = in.createByteArray(); |
| 44 | } |
| 45 | |
| 46 | @Override |
| 47 | public int describeContents() { |
| 48 | return 0; |
| 49 | } |
| 50 | |
| 51 | @Override |
| 52 | public void writeToParcel(Parcel out, int flags) { |
| 53 | out.writeByteArray(blob); |
| 54 | } |
| 55 | } |