UpdateHostSigner updates the host signer with a new key generated from the provided seed. If an existing host key exists with the same algorithm, it is overwritten
(seed int64)
| 1368 | // UpdateHostSigner updates the host signer with a new key generated from the provided seed. |
| 1369 | // If an existing host key exists with the same algorithm, it is overwritten |
| 1370 | func (s *Server) UpdateHostSigner(seed int64) error { |
| 1371 | key, err := CoderSigner(seed) |
| 1372 | if err != nil { |
| 1373 | return err |
| 1374 | } |
| 1375 | |
| 1376 | s.mu.Lock() |
| 1377 | defer s.mu.Unlock() |
| 1378 | |
| 1379 | s.srv.AddHostKey(key) |
| 1380 | |
| 1381 | return nil |
| 1382 | } |
| 1383 | |
| 1384 | // CoderSigner generates a deterministic SSH signer based on the provided seed. |
| 1385 | // It uses RSA with a key size of 2048 bits. |