Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | private function _getDigest() : string { |
||
27 | |||
28 | $privateKey = openssl_pkey_get_private(file_get_contents($this->_account->getKeyDirectoryPath() . 'private.pem')); |
||
29 | $details = openssl_pkey_get_details($privateKey); |
||
30 | |||
31 | $header = array( |
||
32 | "e" => Utilities\Base64::UrlSafeEncode($details["rsa"]["e"]), |
||
33 | "kty" => "RSA", |
||
34 | "n" => Utilities\Base64::UrlSafeEncode($details["rsa"]["n"]) |
||
35 | |||
36 | ); |
||
37 | return Utilities\Base64::UrlSafeEncode(hash('sha256', json_encode($header), true)); |
||
38 | } |
||
39 | } |