E2eeInterface.aidl (1417B) - raw


      1 package me.rhunk.snapenhance.bridge.e2ee;
      2 
      3 import me.rhunk.snapenhance.bridge.e2ee.EncryptionResult;
      4 
      5 interface E2eeInterface {
      6     /**
      7     * Start a new pairing process with a friend
      8     * @param friendId
      9     * @return the pairing public key
     10     */
     11    @nullable byte[] createKeyExchange(String friendId);
     12 
     13     /**
     14     * Accept a pairing request from a friend
     15     * @param friendId
     16     * @param publicKey the public key received from the friend
     17     * @return the encapsulated secret to send to the friend
     18     */
     19     @nullable byte[] acceptPairingRequest(String friendId, in byte[] publicKey);
     20 
     21     /**
     22      * Accept a pairing response from a friend
     23      * @param friendId
     24      * @param encapsulatedSecret the encapsulated secret received from the friend
     25      * @return true if the pairing was successful
     26     */
     27     boolean acceptPairingResponse(String friendId, in byte[] encapsulatedSecret);
     28 
     29     /**
     30     * Check if a friend key exists
     31     * @param friendId
     32     * @return true if the friend key exists
     33     */
     34     boolean friendKeyExists(String friendId);
     35 
     36     /**
     37     * Get the fingerprint of a secret key
     38     * @param friendId
     39     * @return the fingerprint of the secret key
     40     */
     41     @nullable String getSecretFingerprint(String friendId);
     42 
     43     @nullable EncryptionResult encryptMessage(String friendId, in byte[] message);
     44 
     45     @nullable byte[] decryptMessage(String friendId, in byte[] message, in byte[] iv);
     46 }