Load method will try to load in memory previously saved
key using Save method, or saved
using external programs such as ssh-keygen included in OpenSSH package. File
should be accessible and readable by yourself (and thus the
server) in a time when Load is requested.
If Load is successful, wodSSHD will recognize key type
(RSAkey or DSAkey) and overwrite old one from memory (if
any). If you use two keys (RSAkey
and DSAkey) for your server, you
should call Load method twice, specifying different file in
each call.
Saved key should be in PEM
format. PEM format is simply base64 encoded data
surrounded by header lines (this is the format that is used
in Save method) and is widely supported by different SSH
implementations. Load additionally transparently handle
PKCS#8 format encrypted and unencrypted keys too. Typical
structure looks like this (for RSAKey):
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CFB,33E78EDBC3F91072
bKxPNDjHoqW4wT46OnYnDWtJnhwhqRIh81o9IAjjrrlRRDQf9kefDFuciKBrJCqK
................................................................
(...more...)
................................................................
ViWBhtNOV1Wzm3Ifv9ekm6cd1TjPO2UP/Vi5/Xz4PQ+maA7c1QXbdXGF29fc2VFI
JQKZxKKEfirZntyOH6chDQGeYnB7mXLpRNnNb7g=
-----END RSA PRIVATE KEY-----
If loading fails, an error will be generating describing
the error. Most common error when loading the key will
occur if password does not match one that was used when key
was saved.