37 #ifndef VIRGIL_CRYPTO_SIGNER_BASE_H
38 #define VIRGIL_CRYPTO_SIGNER_BASE_H
40 #include "VirgilByteArray.h"
41 #include "foundation/VirgilHash.h"
42 #include "foundation/VirgilAsymmetricCipher.h"
44 namespace virgil {
namespace crypto {
133 virtual bool doVerifyHash(
Algorithm
Enumerates possible Hash algorithms.
Definition: VirgilHash.h:57
bool verifyHash(const VirgilByteArray &digest, const VirgilByteArray &signature, const VirgilByteArray &publicKey)
Verify signature over pre-calculated hash.
Provides asymmetric ciphers algorithms (PK).
Definition: VirgilAsymmetricCipher.h:52
Provides hashing (message digest) algorithms.
Definition: VirgilHash.h:52
This class provides common functionality to sign and verify data using Virgil Security keys...
Definition: VirgilSignerBase.h:49
VirgilByteArray packSignature(const VirgilByteArray &signature) const
Pack given signature to the ASN.1 structure.
std::vector< unsigned char > VirgilByteArray
This type represents a sequence of bytes.
Definition: VirgilByteArray.h:50
VirgilByteArray unpackSignature(const VirgilByteArray &packedSignature)
Unpack signature and correspond hash algorithm from the ASN.1 structure.
VirgilByteArray signHash(const VirgilByteArray &digest, const VirgilByteArray &privateKey, const VirgilByteArray &privateKeyPassword=VirgilByteArray())
Create signature over pre-calculated hash.
foundation::VirgilHash::Algorithm getHashAlgorithm() const
Return hash algorithm that SHOULD be used to calculate digest of the data to be signed.
VirgilSignerBase(foundation::VirgilHash::Algorithm hashAlgorithm=foundation::VirgilHash::Algorithm::SHA384)
Create signer with predefined hash function.