summaryrefslogtreecommitdiff
path: root/identity/aidl/default/common/SecureHardwareProxy.h
diff options
context:
space:
mode:
authorDavid Zeuthen <zeuthen@google.com>2021-09-11 13:59:43 -0400
committerDavid Zeuthen <zeuthen@google.com>2022-01-10 15:12:33 -0500
commit1eb12b29728adcbbe5b8694f671c67b8a624fe4a (patch)
treee62dafc3d8e318621ec258811ac02b9af7f61039 /identity/aidl/default/common/SecureHardwareProxy.h
parent02d2df7135351dad3ae5f11295fca50a483f8754 (diff)
identity: Add multi-document presentation support.
This new IPresentationSession interface enables an application to do a multi-document presentation, something which isn't possible with the existing API. As a practical example of this consider presenting both your Mobile Driving License and your Vaccination Certificate in a single transaction. Bug: 197965513 Test: New CTS tests and new screen in CtsVerifier Change-Id: I11712dca35df7f1224debf454731bc17ea9bfb37
Diffstat (limited to 'identity/aidl/default/common/SecureHardwareProxy.h')
-rw-r--r--identity/aidl/default/common/SecureHardwareProxy.h52
1 files changed, 41 insertions, 11 deletions
diff --git a/identity/aidl/default/common/SecureHardwareProxy.h b/identity/aidl/default/common/SecureHardwareProxy.h
index a1ed1ef03b..a580444230 100644
--- a/identity/aidl/default/common/SecureHardwareProxy.h
+++ b/identity/aidl/default/common/SecureHardwareProxy.h
@@ -42,6 +42,7 @@ using ::std::vector;
// Forward declare.
//
class SecureHardwareProvisioningProxy;
+class SecureHardwareSessionProxy;
class SecureHardwarePresentationProxy;
// This is a class used to create proxies.
@@ -52,6 +53,7 @@ class SecureHardwareProxyFactory : public RefBase {
virtual ~SecureHardwareProxyFactory() {}
virtual sp<SecureHardwareProvisioningProxy> createProvisioningProxy() = 0;
+ virtual sp<SecureHardwareSessionProxy> createSessionProxy() = 0;
virtual sp<SecureHardwarePresentationProxy> createPresentationProxy() = 0;
};
@@ -64,8 +66,12 @@ class SecureHardwareProvisioningProxy : public RefBase {
virtual bool initialize(bool testCredential) = 0;
- virtual bool initializeForUpdate(bool testCredential, string docType,
- vector<uint8_t> encryptedCredentialKeys) = 0;
+ virtual bool initializeForUpdate(bool testCredential, const string& docType,
+ const vector<uint8_t>& encryptedCredentialKeys) = 0;
+
+ virtual optional<uint32_t> getId() = 0;
+
+ virtual bool shutdown() = 0;
// Returns public key certificate chain with attestation.
//
@@ -76,7 +82,7 @@ class SecureHardwareProvisioningProxy : public RefBase {
virtual optional<vector<uint8_t>> createCredentialKey(const vector<uint8_t>& challenge,
const vector<uint8_t>& applicationId) = 0;
- virtual bool startPersonalization(int accessControlProfileCount, vector<int> entryCounts,
+ virtual bool startPersonalization(int accessControlProfileCount, const vector<int>& entryCounts,
const string& docType,
size_t expectedProofOfProvisioningSize) = 0;
@@ -98,8 +104,6 @@ class SecureHardwareProvisioningProxy : public RefBase {
// Returns encryptedCredentialKeys (80 bytes).
virtual optional<vector<uint8_t>> finishGetCredentialData(const string& docType) = 0;
-
- virtual bool shutdown() = 0;
};
enum AccessCheckResult {
@@ -110,6 +114,30 @@ enum AccessCheckResult {
kReaderAuthenticationFailed,
};
+// The proxy used for sessions.
+//
+class SecureHardwareSessionProxy : public RefBase {
+ public:
+ SecureHardwareSessionProxy() {}
+
+ virtual ~SecureHardwareSessionProxy() {}
+
+ virtual bool initialize() = 0;
+
+ virtual optional<uint32_t> getId() = 0;
+
+ virtual bool shutdown() = 0;
+
+ virtual optional<uint64_t> getAuthChallenge() = 0;
+
+ // Returns private key
+ virtual optional<vector<uint8_t>> getEphemeralKeyPair() = 0;
+
+ virtual bool setReaderEphemeralPublicKey(const vector<uint8_t>& readerEphemeralPublicKey) = 0;
+
+ virtual bool setSessionTranscript(const vector<uint8_t>& sessionTranscript) = 0;
+};
+
// The proxy used for presentation.
//
class SecureHardwarePresentationProxy : public RefBase {
@@ -117,12 +145,16 @@ class SecureHardwarePresentationProxy : public RefBase {
SecureHardwarePresentationProxy() {}
virtual ~SecureHardwarePresentationProxy() {}
- virtual bool initialize(bool testCredential, string docType,
- vector<uint8_t> encryptedCredentialKeys) = 0;
+ virtual bool initialize(uint32_t sessionId, bool testCredential, const string& docType,
+ const vector<uint8_t>& encryptedCredentialKeys) = 0;
+
+ virtual optional<uint32_t> getId() = 0;
+
+ virtual bool shutdown() = 0;
// Returns publicKeyCert (1st component) and signingKeyBlob (2nd component)
- virtual optional<pair<vector<uint8_t>, vector<uint8_t>>> generateSigningKeyPair(string docType,
- time_t now) = 0;
+ virtual optional<pair<vector<uint8_t>, vector<uint8_t>>> generateSigningKeyPair(
+ const string& docType, time_t now) = 0;
// Returns private key
virtual optional<vector<uint8_t>> createEphemeralKeyPair() = 0;
@@ -174,8 +206,6 @@ class SecureHardwarePresentationProxy : public RefBase {
virtual optional<vector<uint8_t>> proveOwnership(const string& docType, bool testCredential,
const vector<uint8_t>& challenge,
size_t proofOfOwnershipCborSize) = 0;
-
- virtual bool shutdown() = 0;
};
} // namespace android::hardware::identity