CatapultServer  v0.5.0.1 (Elephant)
Signer.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "KeyPair.h"
23 #include <vector>
24 
25 namespace catapult { namespace crypto {
26 
29  void Sign(const KeyPair& keyPair, const RawBuffer& dataBuffer, Signature& computedSignature);
30 
33  void Sign(const KeyPair& keyPair, std::initializer_list<const RawBuffer> buffersList, Signature& computedSignature);
34 
37  bool Verify(const Key& publicKey, const RawBuffer& dataBuffer, const Signature& signature);
38 
41  bool Verify(const Key& publicKey, std::initializer_list<const RawBuffer> buffersList, const Signature& signature);
42 }}
exceptions.h
CryptoUtils.h
catapult::crypto::Keccak_512_Builder
KeccakBuilder< KeccakModeTag, Hash512_tag > Keccak_512_Builder
Keccak_512_Builder.
Definition: Hashes.h:97
catapult::validators::Notification
model::AccountAddressNotification Notification
Definition: AddressValidator.cpp:27
RESTRICT
#define RESTRICT
Definition: Signer.cpp:36
catapult::Hash512_Size
constexpr size_t Hash512_Size
Definition: src/catapult/types.h:33
catapult::Signature_Size
constexpr size_t Signature_Size
Definition: src/catapult/types.h:31
KeyPair.h
CATAPULT_THROW_OUT_OF_RANGE
#define CATAPULT_THROW_OUT_OF_RANGE(MESSAGE)
Macro used to throw a catapult out of range.
Definition: exceptions.h:191
catapult::utils::ByteArray::data
constexpr const uint8_t * data() const noexcept
Returns a const pointer to the underlying array.
Definition: ByteArray.h:70
catapult::validators::MAKE_STATELESS_VALIDATOR
for(const auto &name :reservedRootNamespaceNames) reservedRootIds.emplace(model return MAKE_STATELESS_VALIDATOR(NamespaceName,([maxNameSize, reservedRootIds](const auto &notification) { if(maxNameSize< notification.NameSize||!model::IsValidName(notification.NamePtr, notification.NameSize)) return Failure_Namespace_Invalid_Name;auto name=utils::RawString(reinterpret_cast< const char * >(notification.NamePtr), notification.NameSize);if(notification.NamespaceId !=model::GenerateNamespaceId(notification.ParentId, name)) return Failure_Namespace_Name_Id_Mismatch;auto namespaceId=Namespace_Base_Id==notification.ParentId ? notification.NamespaceId :notification.ParentId;if(reservedRootIds.cend() !=reservedRootIds.find(namespaceId)) return Failure_Namespace_Root_Name_Reserved;return ValidationResult::Success;}))
Definition: NamespaceNameValidator.cpp:36
Hashes.h
catapult::crypto::HashPrivateKey
void HashPrivateKey(const PrivateKey &privateKey, Hash512 &hash)
Calculates hash of a privateKey.
Definition: CryptoUtils.cpp:31
catapult::crypto::KeyPair
Represents a pair of private key with associated public key.
Definition: KeyPair.h:33
Signer.h
catapult::crypto::KeyPair::privateKey
const auto & privateKey() const
Returns a private key of a key pair.
Definition: KeyPair.h:51
Validators.h
catapult::crypto::KeyPair::publicKey
const auto & publicKey() const
Returns a public key of a key pair.
Definition: KeyPair.h:56
catapult::validators::ValidationResult::Success
Validation succeeded.
catapult::validators::DECLARE_STATELESS_VALIDATOR
DECLARE_STATELESS_VALIDATOR(MaxTransactions, Notification)(uint32_t maxTransactions)
Definition: MaxTransactionsValidator.cpp:27
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::model::AccountAddressNotification
Notification of use of an account address.
Definition: Notifications.h:57
catapult::crypto::Verify
bool Verify(const Key &publicKey, const RawBuffer &dataBuffer, const Signature &signature)
Definition: Signer.cpp:136
catapult::utils::ByteArray
Base class for wrappers of byte array types, to provide some type-safety.
Definition: ByteArray.h:29
catapult::crypto::Sha3_512_Builder
KeccakBuilder< Sha3ModeTag, Hash512_tag > Sha3_512_Builder
Sha3_512_Builder.
Definition: Hashes.h:89
catapult::crypto::Sign
void Sign(const KeyPair &keyPair, const RawBuffer &dataBuffer, Signature &computedSignature)
Definition: Signer.cpp:82
catapult::Key
utils::ByteArray< Key_Size, Key_tag > Key
Definition: src/catapult/types.h:41
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62