Skip to content

Commit

Permalink
修复my生成bug
Browse files Browse the repository at this point in the history
  • Loading branch information
helei5 committed Mar 25, 2018
1 parent 057a2cd commit c7a9b26
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Utils/StrUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ public static function getRsaKeyValue($key, $type = 'private')
$beginStr = '-----BEGIN PUBLIC KEY-----';
$endStr = '-----END PUBLIC KEY-----';
}
$rsaKey = chunk_split(base64_encode($keyStr), 64, "\n");
$rsaKey = $beginStr . PHP_EOL . $keyStr . PHP_EOL . $endStr;
$keyStr = str_replace($beginStr, '', $keyStr);
$keyStr = str_replace($endStr, '', $keyStr);

$rsaKey = chunk_split($keyStr, 64, PHP_EOL);
$rsaKey = $beginStr . PHP_EOL . $rsaKey . $endStr;

return $rsaKey;
}
Expand Down

0 comments on commit c7a9b26

Please sign in to comment.