Page:
Intents
Pages
API Design
Alternative Passphrase Methods
App Security
Backups
Build Security
Competing Apps
Database Design
Google Summer of Code 2014
Google Summer of Code 2015
Google Summer of Code 2016
Home
Icons and Colors
Intents
Keyserver less OpenPGP
Language Conventions
OpenPGP Key Transfer
OpenPGP Security
Paper
QR Codes
Release Management
Secure OpenPGP Key Pair Synchronization via IMAP
Security Tokens
Test URLs
Vulnerabilities
cure53 Security Audit 2015
5
Intents
Dominik Schürmann edited this page 2017-02-05 12:33:25 +01:00
These Intents can be used without using Android permissions to start OpenKeychain activities for cryptographic operations, such as encrypt/decrypt/sign/verify, or other method, such as key import.
Usage
All Intents require user interaction, e.g. to finally encrypt the user needs to press the "Encrypt" button. To do automatic encryption/decryption/sign/verify use the OpenPGP API.
Example Code
Please look into OpenKeychainIntentsActivity.
Intents
Android Intent actions:
android.intent.action.VIEW
connected to .gpg and .asc files: Import Key and Decryptandroid.intent.action.SEND
connected to all mime types (text/plain and every binary data like files and images): Encrypt and Decryptandroid.intent.action.SEND_MULTIPLE
connected to all mime types excepttext/*
andmessage/*
Preferred MIME types
application/pgp-message
for encrypted OpenPGP dataapplication/pgp-keys
to import OpenPGP keys
Panic Intent
info.guardianproject.panic.action.TRIGGER
: Clear password cache immediately. Fore more information see Guardian Project's blog post
OpenKeychain Intent actions:
We are following Android Guidelines by including the full package name as a prefix.
org.sufficientlysecure.keychain.action.ENCRYPT_TEXT
org.sufficientlysecure.keychain.action.EXTRA_TEXT
: To encrypt or sign text, use this extra (type:String
)
org.sufficientlysecure.keychain.action.ENCRYPT_DATA
- Set data
Uri
(intent.setData()
) pointing to a file/image, anything that can be read via an InputStream org.sufficientlysecure.keychain.action.EXTRA_ASCII_ARMOR
: Enable ASCII Armor for file encryption (encoding to Radix-64, 33% overhead) by adding the extra with valuetrue
- Set data
org.sufficientlysecure.keychain.action.DECRYPT_TEXT
org.sufficientlysecure.keychain.action.EXTRA_TEXT
: To decrypt or verify text, use this extra (type:String
)
org.sufficientlysecure.keychain.action.DECRYPT_DATA
- Set data
Uri
(intent.setData()
) pointing to a file
- Set data
org.sufficientlysecure.keychain.action.IMPORT_KEY
org.sufficientlysecure.keychain.action.EXTRA_KEY_BYTES
: key as byte array (type:byte[]
)- or set data
Uri
(intent.setData()
) pointing to a file
org.sufficientlysecure.keychain.action.IMPORT_KEY_FROM_KEYSERVER
org.sufficientlysecure.keychain.action.EXTRA_QUERY
:Extras:query
(type:String
)- or
org.sufficientlysecure.keychain.action.EXTRA_FINGERPRINT
(type:String
)
org.sufficientlysecure.keychain.action.IMPORT_KEY_FROM_QR_CODE
- without extras, starts Barcode Scanner to get QR Code
QR Codes
see QR Codes
NFC
- NFC (
android.nfc.action.NDEF_DISCOVERED
) on mime typeapplication/pgp-keys
(as specified in http://tools.ietf.org/html/rfc3156, section 7)