Lines Matching refs:key
67 * @param string $key
71 public static function load($key, $password = '') argument
73 if (!Strings::is_stringable($key)) {
74 throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
80 if (strpos($key, 'BEGIN OPENSSH PRIVATE KEY') !== false) {
81 $key = preg_replace('#(?:^-.*?-[\r\n]*$)|\s#ms', '', $key);
82 $key = Base64::decode($key);
83 $magic = Strings::shift($key, 15);
87 list($ciphername, $kdfname, $kdfoptions, $numKeys) = Strings::unpackSSH2('sssN', $key);
125 list($publicKey, $paddedKey) = Strings::unpackSSH2('ss', $key);
137 $parts = explode(' ', $key, 3);
140 $key = base64_decode($parts[0]);
145 $key = base64_decode($parts[1]);
148 if ($key === false) {
149 throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
152 list($type) = Strings::unpackSSH2('s', $key);
157 if (strlen($key) <= 4) {
161 $publicKey = $key;
227 $key = Strings::packSSH2('sssNss', 'none', 'none', '', 1, $publicKey, $paddedKey);
228 $key = "openssh-key-v1\0$key";
231 chunk_split(Base64::encode($key), 70, "\n") .