Skip to content

Commit

Permalink
Merge pull request #3 from TheDhejavu/chore/update-reamdme
Browse files Browse the repository at this point in the history
update readme
  • Loading branch information
TheDhejavu authored Jul 5, 2024
2 parents c4d3db9 + 3cbcc65 commit 8f6809a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,30 @@ flowchart LR
- **Validation of App Attestations**: Ensure that the attestation received from an iOS device is valid and conforms to Apple's guidelines.
- **Assertion Verification**: Verify assertions made by iOS applications to confirm their authenticity.

## Installation

Add `appattest-rs` to the `[dependencies]` section of your `Cargo.toml`:

```toml
...

[dependencies]
appattest-rs = "0.1.0"

...
```

Alternatively, with `cargo add`:

```bash
$ cargo add appattest-rs
```

## Usage

### Verifying an Attestation
`src/main.rs`:

```rust
use appattest_rs::attestation::Attestation;

Expand All @@ -57,6 +78,8 @@ fn main() {
```

### Verifying an Assertion
`src/main.rs`:

```rust
use appattest_rs::assertion::Assertion;
use base64::{engine::general_purpose, Engine};
Expand Down
2 changes: 1 addition & 1 deletion examples/assertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use base64::{engine::general_purpose, Engine};

fn main() {
let client_data_json = r#"{"challenge": "5b3b2303-e650-4a56-a9ec-33e3e2a90d14"}"#.as_bytes().to_vec();
let app_id = "<APPLE_TEAM_ID>.<APPLE_APP_ID>"; // replace this with yours. E.g 9000738U8.auth.iphone.com
let app_id = "<APPLE_TEAM_ID>.<APPLE_APP_ID>"; // replace this with yours. E.g 9000738UU8.auth.iphone.com
let public_key_base64 = "BLROJkpk8NoHVHAnkLOKWUrc4MhyMkATpDyDwjEk82o+uf+KCQiDoHZdlcJ1ff5HPgK7Jd/pTA3cyKOq5MYM6Gs=";
let public_key_byte = general_purpose::STANDARD.decode(public_key_base64).expect("unable to decode public key");

Expand Down

0 comments on commit 8f6809a

Please sign in to comment.