Crates.io | hide_my_email |
lib.rs | hide_my_email |
version | 0.1.3 |
source | src |
created_at | 2024-01-30 13:13:51.083817 |
updated_at | 2024-01-31 01:22:24.139424 |
description | iCloud Hide My Email implementation in Rust |
homepage | |
repository | https://github.com/0xlunar/hide_my_email |
max_upload_size | |
id | 1120219 |
size | 16,772 |
Rust implementation of Apple's Hide my email service
cargo add hide_my_email
use std::env;
use hide_my_email::{Cookie, HideMyEmailManager, ICloudClient};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// eg, key1=value1; key2=\"value2\";
let cookies = env::var("COOKIE").unwrap();
let cookies = Cookie::from_str(&cookies).unwrap();
let mut icloud = ICloudClient::new(&cookies);
let _ = icloud.validate().await?;
let manager = HideMyEmailManager::from(icloud);
let email = manager.generate().await?;
let _ = manager.claim(&email, "RustLang", "").await?;
// OR
let email = manager.generate_and_claim("RustLang", "").await?;
Ok(())
}
Add authentication support via Username/Password + 2FA instead of cookies