├── .gitignore └── src └── main └── proto └── securepushservice.proto /.gitignore: -------------------------------------------------------------------------------- 1 | ### Java template 2 | # Compiled class file 3 | *.class 4 | .idea 5 | 6 | # Log file 7 | *.log 8 | 9 | # BlueJ files 10 | *.ctxt 11 | 12 | # Mobile Tools for Java (J2ME) 13 | .mtj.tmp/ 14 | 15 | # Package Files # 16 | *.jar 17 | *.war 18 | *.nar 19 | *.ear 20 | *.zip 21 | *.tar.gz 22 | *.rar 23 | 24 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 25 | hs_err_pid* 26 | 27 | ### Gradle template 28 | .gradle 29 | **/build/ 30 | !src/**/build/ 31 | 32 | # Ignore Gradle GUI config 33 | gradle-app.setting 34 | 35 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 36 | !gradle-wrapper.jar 37 | 38 | # Cache of project 39 | .gradletasknamecache 40 | 41 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 42 | # gradle/wrapper/gradle-wrapper.properties 43 | 44 | ### Kotlin template 45 | # Compiled class file 46 | *.class 47 | 48 | # Log file 49 | *.log 50 | 51 | # BlueJ files 52 | *.ctxt 53 | 54 | # Mobile Tools for Java (J2ME) 55 | .mtj.tmp/ 56 | 57 | # Package Files # 58 | *.jar 59 | *.war 60 | *.nar 61 | *.ear 62 | *.zip 63 | *.tar.gz 64 | *.rar 65 | 66 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 67 | hs_err_pid* 68 | 69 | !/gradlew 70 | /gradlew 71 | /gradlew.bat 72 | /gradle/ 73 | -------------------------------------------------------------------------------- /src/main/proto/securepushservice.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package capillary.kmp; 4 | 5 | option java_multiple_files = true; 6 | 7 | message ByteArrayElement{ 8 | int32 byte = 1; 9 | } 10 | 11 | message Empty { 12 | string nothing = 1; 13 | } 14 | 15 | // The types of public keys. 16 | enum KeyAlgorithm { 17 | RSA_ECDSA = 0; 18 | } 19 | 20 | // Container for a RSA hybrid encryption ciphertext. 21 | message HybridRsaCiphertext { 22 | repeated ByteArrayElement symmetrickeyciphertext = 1; 23 | repeated ByteArrayElement payloadciphertext = 2; 24 | } 25 | 26 | // Container for a raw RSA public key and its associated metadata. 27 | message WrappedRsaEcdsaPublicKey { 28 | string padding = 1; 29 | repeated ByteArrayElement keybytes = 2; 30 | } 31 | 32 | // Container for a Capillary public key and its associated metadata. 33 | message SlackPublicKey { 34 | repeated ByteArrayElement keybytes = 4; 35 | } 36 | 37 | // Container for a Slack ciphertext and its associated metadata. 38 | message SlackCiphertext { 39 | repeated ByteArrayElement ciphertext = 4; 40 | } 41 | 42 | // A request to register the given public key for the specified user. 43 | message AddOrUpdatePublicKeyRequest { 44 | string deviceid = 1; 45 | KeyAlgorithm algorithm = 2; 46 | repeated ByteArrayElement keyBytes = 3; 47 | } 48 | 49 | // A request to add the given user or update the FCM token of an existing user. 50 | message AddOrUpdateUserRequest { 51 | string deviceid = 1; 52 | string token = 2; 53 | } 54 | 55 | service SecurePushService { 56 | rpc addOrUpdateUser (AddOrUpdateUserRequest) returns (Empty); 57 | rpc addOrUpdatePublicKey (AddOrUpdatePublicKeyRequest) returns (Empty); 58 | } --------------------------------------------------------------------------------