Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android.yubikey.intent.action.CHALLENGE_RESPONSE intent #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ of YubiKeys into other apps. Both USB and NFC (YubiKey NEO required for NFC) are

## Integration
ykDroid provides an [Intent](https://developer.android.com/reference/android/content/Intent.html) called
`net.pp3345.ykdroid.intent.action.CHALLENGE_RESPONSE`, which accepts an extra `byte[] challenge` and returns an extra
`android.yubikey.intent.action.CHALLENGE_RESPONSE`, which accepts an extra `byte[] challenge` and returns an extra
`byte[] response`. Optionally, an extra `String purpose` may be passed additionally in the intent to identify the purpose
of the challenge. ykDroid will use this identifier to remember and pre-select the slot used for each purpose.

Expand All @@ -24,7 +24,7 @@ Example code:
private static final int CHALLENGE_RESPONSE_REQUEST_CODE = 12345;

private void startChallengeResponse(final byte[] challenge) {
final Intent intent = new Intent("net.pp3345.ykdroid.intent.action.CHALLENGE_RESPONSE");
final Intent intent = new Intent("android.yubikey.intent.action.CHALLENGE_RESPONSE");
intent.putExtra("challenge", challenge);
intent.putExtra("purpose", "some-unique-purpose-identifier"); // optional

Expand All @@ -43,6 +43,7 @@ public void onActivityResult(final int requestCode, final int resultCode, final
* [Keepass2Android](https://play.google.com/store/apps/details?id=keepass2android.keepass2android) - Password manager
app compatible with KeePass
* [ykpass](https://github.com/noliran/ykpass) - Password app that derives passwords directly from the YubiKey's response value
* [KeePassDX](https://www.keepassdx.com/) - Another password manager app compatible with KeePass

## Contributing
PRs welcome! I am open for adding more YubiKey functionality, but bugfixes and additional translations are also very
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
android:exported="true"
android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.MinWidth"
android:configChanges="keyboard|screenSize|screenLayout|touchscreen|locale|keyboardHidden|navigation">
<intent-filter>
<action android:name="android.yubikey.intent.action.CHALLENGE_RESPONSE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="net.pp3345.ykdroid.intent.action.CHALLENGE_RESPONSE" />
<category android:name="android.intent.category.DEFAULT" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/**
* May be invoked by Android apps using the
* <code>"net.pp3345.ykdroid.intent.action.CHALLENGE_RESPONSE"</code> intent to send a challenge
* <code>"android.yubikey.intent.action.CHALLENGE_RESPONSE"</code> intent to send a challenge
* to a YubiKey and receive the response.
* <p>
* The challenge must be passed in an extra <code>byte[] challenge</code>. Upon successful completion,
Expand Down