Virgil Security Crypto library  2.6.3
Public Member Functions | List of all members
virgil::crypto::VirgilSeqSigner Class Reference

This class provides high-level interface to sign and verify data using Virgil Security keys. More...

#include <VirgilSeqSigner.h>

Inheritance diagram for virgil::crypto::VirgilSeqSigner:
virgil::crypto::VirgilSignerBase

Public Member Functions

 VirgilSeqSigner (foundation::VirgilHash::Algorithm hashAlgorithm=foundation::VirgilHash::Algorithm::SHA384)
 Create signer with predefined hash function. More...
 
void startSigning ()
 
void startVerifying (const VirgilByteArray &signature)
 
void update (const VirgilByteArray &data)
 
VirgilByteArray sign (const VirgilByteArray &privateKey, const VirgilByteArray &privateKeyPassword=VirgilByteArray())
 Sign data that was collected by update() function. More...
 
bool verify (const VirgilByteArray &publicKey)
 Verify sign and data that was collected by update() function to be conformed to the given public key. More...
 
- Public Member Functions inherited from virgil::crypto::VirgilSignerBase
 VirgilSignerBase (foundation::VirgilHash::Algorithm hashAlgorithm=foundation::VirgilHash::Algorithm::SHA384)
 Create signer with predefined hash function. More...
 
foundation::VirgilHash::Algorithm getHashAlgorithm () const
 Return hash algorithm that SHOULD be used to calculate digest of the data to be signed. More...
 
VirgilByteArray signHash (const VirgilByteArray &digest, const VirgilByteArray &privateKey, const VirgilByteArray &privateKeyPassword=VirgilByteArray())
 Create signature over pre-calculated hash. More...
 
bool verifyHash (const VirgilByteArray &digest, const VirgilByteArray &signature, const VirgilByteArray &publicKey)
 Verify signature over pre-calculated hash. More...
 

Additional Inherited Members

- Protected Member Functions inherited from virgil::crypto::VirgilSignerBase
VirgilByteArray packSignature (const VirgilByteArray &signature) const
 Pack given signature to the ASN.1 structure. More...
 
VirgilByteArray unpackSignature (const VirgilByteArray &packedSignature)
 Unpack signature and correspond hash algorithm from the ASN.1 structure. More...
 

Detailed Description

This class provides high-level interface to sign and verify data using Virgil Security keys.

This module can sign / verify data that is fed to the signer sequentially.

Constructor & Destructor Documentation

virgil::crypto::VirgilSeqSigner::VirgilSeqSigner ( foundation::VirgilHash::Algorithm  hashAlgorithm = foundation::VirgilHash::Algorithm::SHA384)
explicit

Create signer with predefined hash function.

Note
Specified hash function algorithm is used only during signing.

Member Function Documentation

VirgilByteArray virgil::crypto::VirgilSeqSigner::sign ( const VirgilByteArray privateKey,
const VirgilByteArray privateKeyPassword = VirgilByteArray() 
)

Sign data that was collected by update() function.

Returns
Virgil Security sign.
void virgil::crypto::VirgilSeqSigner::startSigning ( )

Start new data signing.

void virgil::crypto::VirgilSeqSigner::startVerifying ( const VirgilByteArray signature)

Start new data verifying.

Parameters
signature-
void virgil::crypto::VirgilSeqSigner::update ( const VirgilByteArray data)

Append new data chunk to be signed or verified.

Parameters
data- next data chunk.
bool virgil::crypto::VirgilSeqSigner::verify ( const VirgilByteArray publicKey)

Verify sign and data that was collected by update() function to be conformed to the given public key.

Returns
true if sign is valid and data was not malformed.

The documentation for this class was generated from the following file: