Skip to content

Commit 73a32c9

Browse files
committed
Add parsed() to return key data on private & public keys
1 parent 87c9053 commit 73a32c9

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Internal/Key.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ public function __construct($dataArray)
1717
$this->dataArray = $dataArray;
1818
}
1919

20+
public function parsed(): array
21+
{
22+
return $this->dataArray;
23+
}
24+
2025
public function publicKeyContents(): string
2126
{
2227
return $this->extractString('key');

tests/Unit/Internal/KeyTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public function testAccessorsUsingFakeKeyData(): void
2121
],
2222
];
2323
$key = new Key($data);
24+
$this->assertSame($data, $key->parsed());
2425
$this->assertSame(512, $key->numberOfBits());
2526
$this->assertSame('x-key', $key->publicKeyContents());
2627
$this->assertTrue($key->type()->isRSA());

0 commit comments

Comments
 (0)