2010-12-29 16:31:58 +00:00
|
|
|
package org.thialfihar.android.apg;
|
|
|
|
|
|
|
|
|
|
interface IApgService {
|
2011-06-05 19:05:57 +00:00
|
|
|
|
|
|
|
|
/* All functions fill the returnVals Bundle with the following keys:
|
2011-01-05 14:07:09 +00:00
|
|
|
*
|
|
|
|
|
* ArrayList<String> "WARNINGS" = Warnings, if any
|
2011-01-20 20:00:28 +00:00
|
|
|
* ArrayList<String> "ERRORS" = Human readable error descriptions, if any
|
2011-06-05 19:05:57 +00:00
|
|
|
* int "ERROR" = Numeric representation of error, if any
|
|
|
|
|
* starting with 100:
|
2011-01-20 20:00:28 +00:00
|
|
|
* 100: Required argument missing
|
|
|
|
|
* 101: Generic failure of APG
|
|
|
|
|
* 102: No matching private key found
|
|
|
|
|
* 103: Private key's passphrase wrong
|
|
|
|
|
* 104: Private key's passphrase missing
|
2011-01-05 14:07:09 +00:00
|
|
|
*/
|
|
|
|
|
|
2011-06-05 19:05:57 +00:00
|
|
|
/* ********************************************************
|
|
|
|
|
* Encryption
|
2011-01-23 21:36:35 +00:00
|
|
|
* ********************************************************/
|
|
|
|
|
|
|
|
|
|
/* All encryption function's arguments
|
2011-01-05 14:07:09 +00:00
|
|
|
*
|
2011-01-09 20:12:03 +00:00
|
|
|
* Bundle params' keys:
|
2011-01-18 21:17:14 +00:00
|
|
|
* (optional/required)
|
|
|
|
|
* TYPE "STRING KEY" = EXPLANATION / VALUES
|
2011-01-05 14:07:09 +00:00
|
|
|
*
|
2011-01-18 21:17:14 +00:00
|
|
|
* (required)
|
|
|
|
|
* String "MESSAGE" = Message to encrypt
|
|
|
|
|
*
|
|
|
|
|
* (optional)
|
|
|
|
|
* int "ENCRYPTION_ALGORYTHM" = Encryption Algorithm
|
|
|
|
|
* 7: AES-128, 8: AES-192, 9: AES-256,
|
|
|
|
|
* 4: Blowfish, 10: Twofish, 3: CAST5,
|
|
|
|
|
* 6: DES, 2: Triple DES, 1: IDEA
|
|
|
|
|
* (optional)
|
|
|
|
|
* int "HASH_ALGORYTHM" = Hash Algorithm
|
|
|
|
|
* 1: MD5, 3: RIPEMD-160, 2: SHA-1,
|
|
|
|
|
* 11: SHA-224, 8: SHA-256, 9: SHA-384,
|
|
|
|
|
* 10: SHA-512
|
|
|
|
|
* (optional)
|
|
|
|
|
* Boolean "ARMORED_OUTPUT" = Armor output
|
|
|
|
|
*
|
|
|
|
|
* (optional)
|
|
|
|
|
* Boolean "FORCE_V3_SIGNATURE" = Force V3 Signatures
|
|
|
|
|
*
|
|
|
|
|
* (optional)
|
|
|
|
|
* int "COMPRESSION" = Compression to use
|
|
|
|
|
* 0x21070001: none, 1: Zip, 2: Zlib,
|
|
|
|
|
* 3: BZip2
|
|
|
|
|
* (optional)
|
|
|
|
|
* String "SIGNATURE_KEY" = Key to sign with
|
|
|
|
|
*
|
|
|
|
|
* (optional)
|
2011-01-20 12:49:49 +00:00
|
|
|
* String "PRIVATE_KEY_PASSPHRASE" = Passphrase for signing key
|
2011-01-05 14:07:09 +00:00
|
|
|
*
|
2011-06-05 19:05:57 +00:00
|
|
|
* Bundle returnVals (in addition to the ERRORS/WARNINGS above):
|
2011-01-18 21:17:14 +00:00
|
|
|
* String "RESULT" = Encrypted message
|
2011-01-05 14:07:09 +00:00
|
|
|
*/
|
2011-06-05 19:05:57 +00:00
|
|
|
|
|
|
|
|
/* Additional argument for function below:
|
2011-01-18 21:17:14 +00:00
|
|
|
* (required)
|
|
|
|
|
* String "SYMMETRIC_PASSPHRASE" = Symmetric passphrase to use
|
2011-01-13 20:12:10 +00:00
|
|
|
*/
|
2011-06-05 19:05:57 +00:00
|
|
|
boolean encryptWithPassphrase(in Bundle params, out Bundle returnVals);
|
|
|
|
|
|
2011-01-13 20:12:10 +00:00
|
|
|
/* Additional argument:
|
2011-01-18 21:17:14 +00:00
|
|
|
* (required)
|
|
|
|
|
* ArrayList<String> "PUBLIC_KEYS" = Public keys (8char fingerprint "123ABC12" OR
|
|
|
|
|
* complete id "Alice Meyer <ab@email.com>")
|
2011-01-13 20:12:10 +00:00
|
|
|
*/
|
2011-06-05 19:05:57 +00:00
|
|
|
boolean encryptWithPublicKey(in Bundle params, out Bundle returnVals);
|
2011-01-05 14:07:09 +00:00
|
|
|
|
2011-06-05 19:05:57 +00:00
|
|
|
/* ********************************************************
|
|
|
|
|
* Decryption
|
|
|
|
|
* ********************************************************/
|
|
|
|
|
|
|
|
|
|
/* Bundle params:
|
2011-01-18 21:17:14 +00:00
|
|
|
* (required)
|
|
|
|
|
* String "MESSAGE" = Message to decrypt
|
|
|
|
|
*
|
|
|
|
|
* (optional)
|
|
|
|
|
* String "SYMMETRIC_PASSPHRASE" = Symmetric passphrase for decryption
|
|
|
|
|
*
|
|
|
|
|
* (optional)
|
|
|
|
|
* String "PRIVATE_KEY_PASSPHRASE" = Private keys's passphrase on asymmetric encryption
|
2011-01-05 14:07:09 +00:00
|
|
|
*
|
|
|
|
|
* Bundle return_vals:
|
2011-01-18 21:17:14 +00:00
|
|
|
* String "RESULT" = Decrypted message
|
2011-01-05 14:07:09 +00:00
|
|
|
*/
|
2011-06-05 19:05:57 +00:00
|
|
|
boolean decrypt(in Bundle params, out Bundle returnVals);
|
|
|
|
|
|
|
|
|
|
/* ********************************************************
|
2011-01-23 21:36:35 +00:00
|
|
|
* Get key information
|
|
|
|
|
* ********************************************************/
|
2011-06-05 19:05:57 +00:00
|
|
|
|
2011-01-23 21:36:35 +00:00
|
|
|
/* Get info about all available keys
|
|
|
|
|
*
|
|
|
|
|
* Bundle params:
|
|
|
|
|
* (required)
|
|
|
|
|
* int "KEY_TYPE" = info about what type of keys to return
|
|
|
|
|
* 0: public keys
|
|
|
|
|
* 1: private keys
|
|
|
|
|
*
|
|
|
|
|
* Returns:
|
|
|
|
|
* StringArrayList "FINGERPRINTS" = Short fingerprints of keys
|
|
|
|
|
*
|
2011-06-05 19:05:57 +00:00
|
|
|
* StringArrayList "USER_IDS" = User ids of corresponding fingerprints
|
|
|
|
|
* (order is the same as in FINGERPRINTS)
|
2011-01-23 21:36:35 +00:00
|
|
|
*/
|
2011-06-05 19:05:57 +00:00
|
|
|
boolean getKeys(in Bundle params, out Bundle returnVals);
|
2011-01-23 21:36:35 +00:00
|
|
|
|
2010-12-29 16:31:58 +00:00
|
|
|
}
|