diff options
author | Haamed Gheibi <haamed@google.com> | 2022-02-04 13:47:26 -0800 |
---|---|---|
committer | Haamed Gheibi <haamed@google.com> | 2022-02-04 13:55:47 -0800 |
commit | f99b35c293439db0b7436b47b939eb8c7bf21b51 (patch) | |
tree | 6cd9b0719554809447c845616317cca5409b93ae /identity/aidl/android/hardware | |
parent | a028272dee9220e6810cbdcfb2328c34f8afe4c2 (diff) | |
parent | 332dead340bb196c6ba3f6978e8fb53966c74bf7 (diff) |
Merge TP1A.220120.003
Change-Id: Ie5eba313ee102e452f5f96942ed2f3a7bb4e8f01
Diffstat (limited to 'identity/aidl/android/hardware')
3 files changed, 151 insertions, 4 deletions
diff --git a/identity/aidl/android/hardware/identity/IIdentityCredential.aidl b/identity/aidl/android/hardware/identity/IIdentityCredential.aidl index 8ae293b2d3..84d6ed0e8a 100644 --- a/identity/aidl/android/hardware/identity/IIdentityCredential.aidl +++ b/identity/aidl/android/hardware/identity/IIdentityCredential.aidl @@ -17,9 +17,9 @@ package android.hardware.identity; import android.hardware.identity.Certificate; +import android.hardware.identity.IWritableIdentityCredential; import android.hardware.identity.RequestNamespace; import android.hardware.identity.SecureAccessControlProfile; -import android.hardware.identity.IWritableIdentityCredential; import android.hardware.keymaster.HardwareAuthToken; import android.hardware.keymaster.VerificationToken; @@ -44,6 +44,9 @@ interface IIdentityCredential { * This method was deprecated in API version 3 because there's no challenge so freshness * can't be checked. Use deleteCredentalWithChallenge() instead. * + * If the method is called on an instance obtained via IPresentationSession.getCredential(), + * STATUS_FAILED must be returned. + * * @return a COSE_Sign1 signature described above * @deprecated use deleteCredentalWithChallenge() instead. */ @@ -60,6 +63,9 @@ interface IIdentityCredential { * This method may only be called once per instance. If called more than once, STATUS_FAILED * will be returned. * + * If the method is called on an instance obtained via IPresentationSession.getCredential(), + * STATUS_FAILED must be returned. + * * @return the private key, in DER format as specified in RFC 5915. */ byte[] createEphemeralKeyPair(); @@ -70,6 +76,9 @@ interface IIdentityCredential { * This method may only be called once per instance. If called more than once, STATUS_FAILED * will be returned. * + * If the method is called on an instance obtained via IPresentationSession.getCredential(), + * STATUS_FAILED must be returned. + * * @param publicKey contains the reader's ephemeral public key, in uncompressed * form (e.g. 0x04 || X || Y). */ @@ -83,6 +92,9 @@ interface IIdentityCredential { * This method may only be called once per instance. If called more than once, STATUS_FAILED * will be returned. If user authentication is not needed, this method may not be called. * + * If the method is called on an instance obtained via IPresentationSession.getCredential(), + * STATUS_FAILED must be returned. + * * @return challenge, a non-zero number. */ long createAuthChallenge(); @@ -371,6 +383,9 @@ interface IIdentityCredential { * This CBOR enables an issuer to determine the exact state of the credential it * returns issuer-signed data for. * + * If the method is called on an instance obtained via IPresentationSession.getCredential(), + * STATUS_FAILED must be returned. + * * @param out signingKeyBlob contains an AES-GCM-ENC(storageKey, R, signingKey, docType) * where signingKey is an EC private key in uncompressed form. That is, the returned * blob is an encrypted copy of the newly-generated private signing key. @@ -420,6 +435,9 @@ interface IIdentityCredential { * * This method was introduced in API version 3. * + * If the method is called on an instance obtained via IPresentationSession.getCredential(), + * STATUS_FAILED must be returned. + * * @param challenge a challenge set by the issuer to ensure freshness. Maximum size is 32 bytes * and it may be empty. Fails with STATUS_INVALID_DATA if bigger than 32 bytes. * @return a COSE_Sign1 signature described above. @@ -442,6 +460,9 @@ interface IIdentityCredential { * * This method was introduced in API version 3. * + * If the method is called on an instance obtained via IPresentationSession.getCredential(), + * STATUS_FAILED must be returned. + * * @param challenge a challenge set by the issuer to ensure freshness. Maximum size is 32 bytes * and it may be empty. Fails with STATUS_INVALID_DATA if bigger than 32 bytes. * @return a COSE_Sign1 signature described above. @@ -456,6 +477,9 @@ interface IIdentityCredential { * * This method was introduced in API version 3. * + * If the method is called on an instance obtained via IPresentationSession.getCredential(), + * STATUS_FAILED must be returned. + * * @return an IWritableIdentityCredential */ IWritableIdentityCredential updateCredential(); diff --git a/identity/aidl/android/hardware/identity/IIdentityCredentialStore.aidl b/identity/aidl/android/hardware/identity/IIdentityCredentialStore.aidl index 638be796c4..86be7f5879 100644 --- a/identity/aidl/android/hardware/identity/IIdentityCredentialStore.aidl +++ b/identity/aidl/android/hardware/identity/IIdentityCredentialStore.aidl @@ -16,10 +16,11 @@ package android.hardware.identity; +import android.hardware.identity.CipherSuite; +import android.hardware.identity.HardwareInformation; import android.hardware.identity.IIdentityCredential; +import android.hardware.identity.IPresentationSession; import android.hardware.identity.IWritableIdentityCredential; -import android.hardware.identity.HardwareInformation; -import android.hardware.identity.CipherSuite; /** * IIdentityCredentialStore provides an interface to a secure store for user identity documents. @@ -105,7 +106,7 @@ import android.hardware.identity.CipherSuite; * STATUS_* integers defined in this interface. Each method states which status can be returned * and under which circumstances. * - * The API described here is API version 3 which corresponds to feature version 202101 + * The API described here is API version 4 which corresponds to feature version 202201 * of the android.security.identity Framework API. An XML file declaring the feature * android.hardware.identity_credential (or android.hardware.identity_credential.direct_access * if implementing the Direct Access HAL) should be included declaring this feature version. @@ -241,4 +242,25 @@ interface IIdentityCredentialStore { * @return an IIdentityCredential interface that provides operations on the Credential. */ IIdentityCredential getCredential(in CipherSuite cipherSuite, in byte[] credentialData); + + /** + * createPresentationSession creates IPresentationSession interface which can be used to + * present one or more credentials to a remote verifier device. + * + * The cipher suite used to communicate with the remote verifier must be specified. Currently + * only a single cipher-suite is supported. Support for other cipher suites may be added in a + * future version of this HAL. If the requested cipher suite is not support the call fails + * with STATUS_CIPHER_SUITE_NOT_SUPPORTED. + * + * In this version of the HAL, implementations are only required to support a single session + * being active. In a future version, implementations may be required to support multiple + * presentation sessions being active at the same time. + * + * This method was introduced in API version 4. + * + * @param cipherSuite The cipher suite to use. + * + * @return an IPresentationSession interface. + */ + IPresentationSession createPresentationSession(in CipherSuite cipherSuite); } diff --git a/identity/aidl/android/hardware/identity/IPresentationSession.aidl b/identity/aidl/android/hardware/identity/IPresentationSession.aidl new file mode 100644 index 0000000000..b0449f0bba --- /dev/null +++ b/identity/aidl/android/hardware/identity/IPresentationSession.aidl @@ -0,0 +1,101 @@ +/* + * Copyright 2021 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.hardware.identity; + +import android.hardware.identity.CipherSuite; +import android.hardware.identity.IIdentityCredential; + +/** + * An interface to present multiple credentials in the same session. + * + * This interface was introduced in API version 4. + * + */ +@VintfStability +interface IPresentationSession { + /** + * Gets the ephemeral EC key pair to be used in establishing a secure session with a reader. + * This method returns the private key so the caller can perform an ECDH key agreement operation + * with the reader. The reason for generating the key pair in the secure environment is so that + * the secure environment knows what public key to expect to find in the session transcript + * when presenting credentials. + * + * The generated key matches the selected cipher suite of the presentation session (e.g. EC + * key using the P-256 curve). + * + * @return the private key, in DER format as specified in RFC 5915. + */ + byte[] getEphemeralKeyPair(); + + /** + * Gets the challenge value to be used for proving successful user authentication. This + * is to be included in the authToken passed to the IIdentityCredential.startRetrieval() + * method and the verificationToken passed to the IIdentityCredential.setVerificationToken() + * method. + * + * @return challenge, a non-zero number. + */ + long getAuthChallenge(); + + /** + * Sets the public part of the reader's ephemeral key pair to be used to complete + * an ECDH key agreement for the session. + * + * The curve of the key must match the curve for the key returned by getEphemeralKeyPair(). + * + * This method may only be called once per instance. If called more than once, STATUS_FAILED + * must be returned. + * + * @param publicKey contains the reader's ephemeral public key, in uncompressed + * form (e.g. 0x04 || X || Y). + */ + void setReaderEphemeralPublicKey(in byte[] publicKey); + + /** + * Sets the session transcript for the session. + * + * This can be empty but if it's non-empty it must be valid CBOR. + * + * This method may only be called once per instance. If called more than once, STATUS_FAILED + * must be returned. + * + * @param sessionTrancsript the session transcript. + */ + void setSessionTranscript(in byte[] sessionTranscript); + + /** + * getCredential() retrieves an IIdentityCredential interface for presentation in the + * current presentation session. + * + * On the returned instance only the methods startRetrieval(), startRetrieveEntryValue(), + * retrieveEntryValue(), finishRetrieval(), setRequestedNamespaces(), setVerificationToken() + * may be called. Other methods will fail with STATUS_FAILED. + * + * The implementation is expected to get the session transcript, ephemeral key, reader + * ephemeral key, and auth challenge from this instance. + * + * @param credentialData is a CBOR-encoded structure containing metadata about the credential + * and an encrypted byte array that contains data used to secure the credential. See the + * return argument of the same name in IWritableIdentityCredential.finishAddingEntries(). + * + * Note that the format of credentialData may depend on the feature version. + * Implementations must support credentialData created by an earlier feature version. + * + * @return an IIdentityCredential interface that provides operations on the Credential. + */ + IIdentityCredential getCredential(in byte[] credentialData); +} |