ssh_signature (ssh_signature v0.1.0)
Link to this section Summary
Functions
Equivalent to sign(Data, Key, NS, #{}).
Sign Data
using SSH signature format with Key
.
Verify Signature
of Data
.
Link to this section Types
Link to this type
hash_algorithm/0
-type hash_algorithm() :: sha256 | sha512.
Link to this type
namespace/0
-type namespace() :: unicode:chardata().
Link to this section Functions
Link to this function
sign(Data, Key, NS)
Equivalent to sign(Data, Key, NS, #{}).
Link to this function
sign(Data, Key, NS, Opts)
-spec sign(iodata(), public_key:private_key(), namespace(), Opts) -> unicode:chardata() when Opts :: #{hash => hash_algorithm()}.
Sign Data
using SSH signature format with Key
.
The NS
must be not empty.
options
Options
hash
- hash algorithm used on input data. Can be eithersha256
orsha512
. Defaults tosha512
.
Link to this function
verify(Data, Signature)
-spec verify(iodata(), unicode:chardata()) -> {ok, Result} | {error, term()} when Result :: #{ns => namespace(), public_key => public_key:public_key(), signature => binary()}.
Verify Signature
of Data
.