Skip to content

Commit

Permalink
JWE Test completed
Browse files Browse the repository at this point in the history
  • Loading branch information
Florent Morselli committed Jan 2, 2015
1 parent 37a6675 commit 835a37c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/JWETest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ public function testCEKEncryption()
// The CEK to encrypt (we convert it into a binary string)
$data = [4, 211, 31, 197, 84, 157, 252, 254, 11, 100, 157, 250, 63, 170, 106, 206, 107, 124, 212, 45, 111, 107, 9, 219, 200, 177, 0, 240, 143, 156, 44, 207];
foreach ($data as $key => $value) {
$data[$key] = str_pad(dechex($value), 2, "0");
$data[$key] = str_pad(dechex($value), 2, "0", STR_PAD_LEFT);
}
$data = hex2bin(implode("", $data));

$wrapper = new A128KW();

$wrapped = $wrapper->wrap($kek, $data);
$this->markTestIncomplete("Unable to verify the example provided by the JWE specification.");
//$this->assertEquals(base64_decode("6KB707dM9YTIgHtLvtgWQ8mKwboJW3of9locizkDTHzBC2IlrT1oOQ"), $wrapped);
$this->assertEquals(base64_decode("6KB707dM9YTIgHtLvtgWQ8mKwboJW3of9locizkDTHzBC2IlrT1oOQ"), $wrapped);
$unwrapped = $wrapper->unwrap($kek, $wrapped);
$this->assertEquals($data, $unwrapped);
}
Expand Down

0 comments on commit 835a37c

Please sign in to comment.