documentation on service

This commit is contained in:
Dominik Schürmann 2014-02-15 15:19:50 +01:00
parent 52f1c930eb
commit f9578d24fa
2 changed files with 48 additions and 34 deletions

View File

@ -22,38 +22,42 @@ interface IOpenPgpService {
* General extras * General extras
* -------------- * --------------
* *
* params: * Bundle params:
* int api_version (current: 1) * int api_version (required)
* boolean ascii_armor true/false (for output) * boolean ascii_armor (request ascii armor for ouput)
* String passphrase (for key, optional)
* *
* Bundle return: * returned Bundle:
* int result_code 0,1, or 2 (see OpenPgpConstants) * int result_code (0, 1, or 2 (see OpenPgpConstants))
* OpenPgpSignatureResult signature_result * OpenPgpError error (if result_code == 0)
* OpenPgpError error * Intent intent (if result_code == 2)
* Intent intent
* *
*/ */
/** /**
* sign only * Sign only
*
* optional params:
* String passphrase (for key passphrase)
*/ */
Bundle sign(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output); Bundle sign(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output);
/** /**
* encrypt * Encrypt
* *
* params: * Bundle params:
* long[] key_ids * long[] key_ids
* or * or
* String[] user_ids (= emails of recipients) (if more than one key has this user_id, an Intent is returned) * String[] user_ids (= emails of recipients) (if more than one key has this user_id, a PendingIntent is returned)
*
* optional params:
* String passphrase (for key passphrase)
*/ */
Bundle encrypt(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output); Bundle encrypt(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output);
/** /**
* sign and encrypt * Sign and encrypt
* *
* params: * Bundle params:
* same as in encrypt() * same as in encrypt()
*/ */
Bundle signAndEncrypt(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output); Bundle signAndEncrypt(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output);
@ -61,16 +65,19 @@ interface IOpenPgpService {
/** /**
* Decrypts and verifies given input bytes. This methods handles encrypted-only, signed-and-encrypted, * Decrypts and verifies given input bytes. This methods handles encrypted-only, signed-and-encrypted,
* and also signed-only input. * and also signed-only input.
*
* returned Bundle:
* OpenPgpSignatureResult signature_result
*/ */
Bundle decryptAndVerify(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output); Bundle decryptAndVerify(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output);
/** /**
* Retrieves key ids based on given user ids (=emails) * Retrieves key ids based on given user ids (=emails)
* *
* params: * Bundle params:
* String[] user_ids * String[] user_ids
* *
* result: * returned Bundle:
* long[] key_ids * long[] key_ids
*/ */
Bundle getKeyIds(in Bundle params); Bundle getKeyIds(in Bundle params);

View File

@ -22,38 +22,42 @@ interface IOpenPgpService {
* General extras * General extras
* -------------- * --------------
* *
* params: * Bundle params:
* int api_version (current: 1) * int api_version (required)
* boolean ascii_armor true/false (for output) * boolean ascii_armor (request ascii armor for ouput)
* String passphrase (for key, optional)
* *
* Bundle return: * returned Bundle:
* int result_code 0,1, or 2 (see OpenPgpConstants) * int result_code (0, 1, or 2 (see OpenPgpConstants))
* OpenPgpSignatureResult signature_result * OpenPgpError error (if result_code == 0)
* OpenPgpError error * Intent intent (if result_code == 2)
* Intent intent
* *
*/ */
/** /**
* sign only * Sign only
*
* optional params:
* String passphrase (for key passphrase)
*/ */
Bundle sign(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output); Bundle sign(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output);
/** /**
* encrypt * Encrypt
* *
* params: * Bundle params:
* long[] key_ids * long[] key_ids
* or * or
* String[] user_ids (= emails of recipients) (if more than one key has this user_id, an Intent is returned) * String[] user_ids (= emails of recipients) (if more than one key has this user_id, a PendingIntent is returned)
*
* optional params:
* String passphrase (for key passphrase)
*/ */
Bundle encrypt(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output); Bundle encrypt(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output);
/** /**
* sign and encrypt * Sign and encrypt
* *
* params: * Bundle params:
* same as in encrypt() * same as in encrypt()
*/ */
Bundle signAndEncrypt(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output); Bundle signAndEncrypt(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output);
@ -61,16 +65,19 @@ interface IOpenPgpService {
/** /**
* Decrypts and verifies given input bytes. This methods handles encrypted-only, signed-and-encrypted, * Decrypts and verifies given input bytes. This methods handles encrypted-only, signed-and-encrypted,
* and also signed-only input. * and also signed-only input.
*
* returned Bundle:
* OpenPgpSignatureResult signature_result
*/ */
Bundle decryptAndVerify(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output); Bundle decryptAndVerify(in Bundle params, in ParcelFileDescriptor input, in ParcelFileDescriptor output);
/** /**
* Retrieves key ids based on given user ids (=emails) * Retrieves key ids based on given user ids (=emails)
* *
* params: * Bundle params:
* String[] user_ids * String[] user_ids
* *
* result: * returned Bundle:
* long[] key_ids * long[] key_ids
*/ */
Bundle getKeyIds(in Bundle params); Bundle getKeyIds(in Bundle params);