1 /*
2  * Copyright (c) 2019, 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.identity;
18 
19 import android.security.identity.RequestNamespaceParcel;
20 import android.security.identity.GetEntriesResultParcel;
21 import android.security.identity.AuthKeyParcel;
22 
23 /**
24  * @hide
25  */
26 interface ICredential {
27     /* The STATUS_* constants are used in the status field in ResultEntryParcel.
28      * Keep in sync with ResultNamespace.java.
29      */
30     const int STATUS_OK = 0;
31     const int STATUS_NO_SUCH_ENTRY = 1;
32     const int STATUS_NOT_REQUESTED = 2;
33     const int STATUS_NOT_IN_REQUEST_MESSAGE = 3;
34     const int STATUS_USER_AUTHENTICATION_FAILED = 4;
35     const int STATUS_READER_AUTHENTICATION_FAILED = 5;
36     const int STATUS_NO_ACCESS_CONTROL_PROFILES = 6;
37 
createEphemeralKeyPair()38     byte[] createEphemeralKeyPair();
39 
setReaderEphemeralPublicKey(in byte[] publicKey)40     void setReaderEphemeralPublicKey(in byte[] publicKey);
41 
deleteCredential()42     byte[] deleteCredential();
43 
getCredentialKeyCertificateChain()44     byte[] getCredentialKeyCertificateChain();
45 
selectAuthKey(in boolean allowUsingExhaustedKeys)46     long selectAuthKey(in boolean allowUsingExhaustedKeys);
47 
getEntries(in byte[] requestMessage, in RequestNamespaceParcel[] requestNamespaces, in byte[] sessionTranscript, in byte[] readerSignature, in boolean allowUsingExhaustedKeys)48     GetEntriesResultParcel getEntries(in byte[] requestMessage,
49                                       in RequestNamespaceParcel[] requestNamespaces,
50                                       in byte[] sessionTranscript,
51                                       in byte[] readerSignature,
52                                       in boolean allowUsingExhaustedKeys);
53 
setAvailableAuthenticationKeys(in int keyCount, in int maxUsesPerKey)54     void setAvailableAuthenticationKeys(in int keyCount, in int maxUsesPerKey);
55 
getAuthKeysNeedingCertification()56     AuthKeyParcel[] getAuthKeysNeedingCertification();
57 
storeStaticAuthenticationData(in AuthKeyParcel authenticationKey, in byte[] staticAuthData)58     void storeStaticAuthenticationData(in AuthKeyParcel authenticationKey, in byte[] staticAuthData);
59 
getAuthenticationDataUsageCount()60     int[] getAuthenticationDataUsageCount();
61 }
62 
63