Can I use it on Android?
kmille opened this issue · 3 comments
Hey,
thanks for your tool! I would like to use it on my Android device. What's the easiest way? A termux package or building it directly for arm? Can you add build instructions for building it for arm? Thanks!
I have no idea if this plugin will work on Android, but it would be neat if it did!
We use the pcsc
crate for YubiKey device access, which in turn uses the pcsc-lite
library and pcscd
daemon on Linux systems. So whether or not it works comes down primarily to how that library behaves on Android.
Here are the "simple" parts of getting this working on Android:
rustup target add x86_64-linux-android
cargo build --target x86_64-linux-android
- Put the resulting
age-plugin-yubikey
binary somewhere into thePATH
of theage
orrage
binary that you are using on your Android device.
And the likely hard parts:
- You need to ensure that the
pcsc
crate builds against a version of thepcsc-lite
library that supports Android. I have no idea ifpcsc-lite
natively supports it yet, or if you'd need a patched version. - There are probably some shenanigans needed to get your phone to recognise your YubiKey via a USB-OTG adapter.
- The age implementation needs plugin support. If you're using
age
orrage
directly then it should Just Work. But if you're using some app that handles age decryption via a library, it will depend on whether that library exposes plugin support. Myage
Rust library does expose it (which I then make use of inrage
), but I have not tested that on Android either.
I'm using it on an Ubuntu chroot without any issues, works like a charm. I do pcscd --foreground &
and pkill pcscd
since I don't have a daemon manager running in the chroot.