1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-04 18:48:24 +01:00

X509: re-use existing BER extraction code

This commit is contained in:
terrafrost 2013-08-02 10:52:58 -05:00
parent 0149644210
commit 7b5542cc8a

View File

@ -4041,9 +4041,7 @@ class File_X509 {
}
// If in PEM format, convert to binary.
if (preg_match('#^-----BEGIN #', $key)) {
$key = base64_decode(preg_replace('#-.+-|[\r\n]#', '', $key));
}
$key = $this->_extractBER($key);
// Now we have the key string: compute its sha-1 sum.
if (!class_exists('Crypt_Hash')) {