Skip to content

Commit

Permalink
lib: Edit TeePubKey
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Fanelli <[email protected]>
  • Loading branch information
tylerfanelli authored and slp committed Mar 10, 2023
1 parent 13b9378 commit 183dfcb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ pub struct Challenge {

#[derive(Clone, Serialize, Deserialize, Debug)]
pub struct TeePubKey {
pub kty: String,
pub alg: String,
pub k: String,
#[serde(rename = "k-mod")]
pub k_mod: String,
#[serde(rename = "k-exp")]
pub k_exp: String,
}

#[derive(Serialize, Deserialize, Debug)]
Expand Down Expand Up @@ -125,18 +127,18 @@ mod tests {
let data = r#"
{
"tee-pubkey": {
"kty": "fakekeytype",
"alg": "fakealgorithm",
"k": "fakepubkey"
"k-mod": "fakemodulus",
"k-exp": "fakeexponent"
},
"tee-evidence": "fakeevidence"
}"#;

let attestation: Attestation = serde_json::from_str(data).unwrap();

assert_eq!(attestation.tee_pubkey.kty, "fakekeytype");
assert_eq!(attestation.tee_pubkey.alg, "fakealgorithm");
assert_eq!(attestation.tee_pubkey.k, "fakepubkey");
assert_eq!(attestation.tee_pubkey.k_mod, "fakemodulus");
assert_eq!(attestation.tee_pubkey.k_exp, "fakeexponent");
assert_eq!(attestation.tee_evidence, "fakeevidence");
}

Expand Down

0 comments on commit 183dfcb

Please sign in to comment.