OpenSSH some time ago learned how to sign arbitrary data. Since then some other tools learned how to utilise such signatures (for example Git, but GitHub do not support them yet). This library provides 2 functions that allows you to create such signatures from Erlang with ease:
key = :public_key.generate_key({rsa, 4096, 65537})
data = "my arbitrary data"
namespace = "text"
signature = :ssh_signature.sign(data, key, namespace)
{:ok, result} = :ssh_signature.verify(signature, data)
# Here you need to check that `result.public_key` and `result.namespace` are what you expect
Source available at