mirror of
https://github.com/NixOS/nix.git
synced 2025-12-17 14:31:06 +01:00
* It is tough to contribute to a project that doesn't use a formatter, * It is extra hard to contribute to a project which has configured the formatter, but ignores it for some files * Code formatting makes it harder to hide obscure / weird bugs by accident or on purpose, Let's rip the bandaid off? Note that PRs currently in flight should be able to be merged relatively easily by applying `clang-format` to their tip prior to merge.
24 lines
434 B
C++
24 lines
434 B
C++
#include "nix/util/signature/signer.hh"
|
|
#include "nix/util/error.hh"
|
|
|
|
#include <sodium.h>
|
|
|
|
namespace nix {
|
|
|
|
LocalSigner::LocalSigner(SecretKey && privateKey)
|
|
: privateKey(privateKey)
|
|
, publicKey(privateKey.toPublicKey())
|
|
{
|
|
}
|
|
|
|
std::string LocalSigner::signDetached(std::string_view s) const
|
|
{
|
|
return privateKey.signDetached(s);
|
|
}
|
|
|
|
const PublicKey & LocalSigner::getPublicKey()
|
|
{
|
|
return publicKey;
|
|
}
|
|
|
|
} // namespace nix
|