SshPrivateKeySigner.publicKey offer is built from the private material and validated.
loadSshPrivateKeyFile
SshSigner loadSshPrivateKeyFile(const(ubyte)[] fileBytes)Loads an unencrypted SSH private key file.
The input may be PEM-armored text or raw DER bytes; the format is detected from the content. Exactly one private key must be present.
Parameters
fileBytes | Complete file contents. |
Returns
Throws
SshKeyException for malformed, unsupported, oversized, or inconsistent files.
SshSigner loadSshPrivateKeyFile(const(ubyte)[] fileBytes,
SshPassphraseProvider provider)Loads a private key file, decrypting encrypted containers with a passphrase acquired from provider.
The provider is called only when the file is actually encrypted and at most maxPassphraseAttempts times per file; a wrong passphrase (detected through the container's integrity check) is retried by asking again. Key loading is synchronous and off the pump path, so a blocking prompt inside the provider is fine.
Applications loading a file repeatedly are encouraged to cache the passphrase per file for the session lifetime instead of prompting again on every load.
Parameters
fileBytes | Complete file contents. |
provider | Passphrase acquisition callback; may be null, which makes this overload behave exactly like the provider-less one. |
Returns
SshPrivateKeySigner.publicKey offer is built from the private material and validated.
Throws
every attempt is rejected; SshKeyEncryptionException for encrypted containers the loader cannot decrypt even with a passphrase; SshKeyException for malformed, unsupported, oversized, or inconsistent files.
SshSigner loadSshPrivateKeyFile(string text)Ditto
SshSigner loadSshPrivateKeyFile(string text,
SshPassphraseProvider provider)Ditto