2 unstable releases
0.2.0 | Mar 8, 2023 |
---|---|
0.1.0 | Mar 7, 2023 |
#962 in Authentication
36KB
726 lines
google_authenticator_converter
- Extract name, secret and issuer from a Google Authenticator migration QR code
Example
use google_authenticator_converter::{extract_data_from_uri, process_data, Account};
let qr_code = "otpauth-migration://offline?data=CjMKCkhlbGxvId6tvu8SGFRlc3QxOnRlc3QxQGV4YW1wbGUxLmNvbRoFVGVzdDEgASgBMAIKMwoKSGVsbG8h3q2%2B8BIYVGVzdDI6dGVzdDJAZXhhbXBsZTIuY29tGgVUZXN0MiABKAEwAgozCgpIZWxsbyHerb7xEhhUZXN0Mzp0ZXN0M0BleGFtcGxlMy5jb20aBVRlc3QzIAEoATACEAEYASAAKI3orYEE";
let accounts = process_data(&qr_code);
for account in accounts.unwrap() {
println!("{0} {1} {2}", account.name, account.secret, account.issuer);
}
Based on
lib.rs
:
Google Authenticator Converter
- Extract name, secret and issuer from a Google Authenticator migration QR code
Example
use google_authenticator_converter::{extract_data_from_uri, process_data, Account};
let qr_code = "otpauth-migration://offline?data=CjMKCkhlbGxvId6tvu8SGFRlc3QxOnRlc3QxQGV4YW1wbGUxLmNvbRoFVGVzdDEgASgBMAIKMwoKSGVsbG8h3q2%2B8BIYVGVzdDI6dGVzdDJAZXhhbXBsZTIuY29tGgVUZXN0MiABKAEwAgozCgpIZWxsbyHerb7xEhhUZXN0Mzp0ZXN0M0BleGFtcGxlMy5jb20aBVRlc3QzIAEoATACEAEYASAAKI3orYEE";
let accounts = process_data(&qr_code);
for account in accounts.unwrap() {
println!("{0} {1} {2}", account.name, account.secret, account.issuer);
}
Dependencies
~2.2–3MB
~65K SLoC