|
Virgil Security C++ SDK
|
Class responsible for operations with Virgil Cards. More...
#include <CardManager.h>
Public Member Functions | |
| CardManager (std::shared_ptr< crypto::Crypto > crypto, std::shared_ptr< jwt::interfaces::AccessTokenProviderInterface > accessTokenProvider, std::shared_ptr< verification::CardVerifierInterface > cardVerifier, std::function< std::future< RawSignedModel >(RawSignedModel)> signCallback=nullptr, std::shared_ptr< client::CardClientInterface > cardClient=std::make_shared< client::CardClient >(), bool retryOnUnauthorized=true) | |
| Constructor. More... | |
| RawSignedModel | generateRawCard (const crypto::keys::PrivateKey &privateKey, const crypto::keys::PublicKey &publicKey, const std::string &identity, const std::string &previousCardId=std::string(), const std::unordered_map< std::string, std::string > &extraFields=std::unordered_map< std::string, std::string >()) const |
| Generates self signed RawSignedModel. More... | |
| Card | parseCard (const RawSignedModel &model) const |
| Imports and verifies Card from RawSignedModel using self Crypto instance. More... | |
| std::future< Card > | publishCard (const RawSignedModel &rawCard) const |
| Asynchronously creates Virgil Card instance on the Virgil Cards Service and associates it with unique identifier Also makes the Card accessible for search/get queries from other users RawSignedModel should be at least selfSigned. More... | |
| std::future< Card > | publishCard (const crypto::keys::PrivateKey &privateKey, const crypto::keys::PublicKey &publicKey, const std::string &identity=std::string(), const std::string &previousCardId=std::string(), const std::unordered_map< std::string, std::string > &extraFields=std::unordered_map< std::string, std::string >()) const |
| Generates self signed RawSignedModel, asynchronously creates Virgil Card instance on the Virgil Cards Service and associates it with unique identifier. More... | |
| std::future< Card > | getCard (const std::string &cardId) const |
| Asynchronously returns Card with given identifier. More... | |
| std::future< std::vector< Card > > | searchCards (const std::string &identity) const |
| Asynchronously performs search of Virgil Cards using identity on the Virgil Cards Service. More... | |
| Card | importCardFromBase64 (const std::string &base64) const |
| Imports and verifies Card from base64 encoded std::string. More... | |
| Card | importCardFromJson (const std::string json) const |
| Imports and verifies Card from json std::string. More... | |
| Card | importCardFromRawCard (const RawSignedModel &rawCard) const |
| Imports and verifies Card from RawSignedModel. More... | |
| std::string | exportCardAsBase64 (const Card &card) const |
| Exports Card as base64 encoded std::string. More... | |
| std::string | exportCardAsJson (const Card &card) const |
| Exports Card as json std::string. More... | |
| RawSignedModel | exportCardAsRawCard (const Card &card) const |
| Exports Card as RawSignedModel. More... | |
| const std::shared_ptr< crypto::Crypto > & | crypto () const |
| Getter. More... | |
| const std::shared_ptr< jwt::interfaces::AccessTokenProviderInterface > & | accessTokenProvider () const |
| Getter. More... | |
| const std::shared_ptr< verification::CardVerifierInterface > & | cardVerifier () const |
| Getter. More... | |
| const ModelSigner & | modelSigner () const |
| Getter. More... | |
| const std::shared_ptr< client::CardClientInterface > & | cardClient () const |
| Getter. More... | |
| const std::function< std::future< RawSignedModel >RawSignedModel)> & | signCallback () const |
| Getter. More... | |
| bool | retryOnUnauthorized () const |
| Getter. More... | |
Static Public Member Functions | |
| static RawSignedModel | generateRawCard (const std::shared_ptr< crypto::Crypto > &crypto, const ModelSigner &modelSigner, const crypto::keys::PrivateKey &privateKey, const crypto::keys::PublicKey &publicKey, const std::string &identity, const std::string &previousCardId=std::string(), const std::unordered_map< std::string, std::string > &extraFields=std::unordered_map< std::string, std::string >()) |
| Generates self signed RawSignedModel. More... | |
| static Card | parseCard (const RawSignedModel &model, const std::shared_ptr< crypto::Crypto > &crypto) |
| Imports Card from RawSignedModel. More... | |
Class responsible for operations with Virgil Cards.
| virgil::sdk::cards::CardManager::CardManager | ( | std::shared_ptr< crypto::Crypto > | crypto, |
| std::shared_ptr< jwt::interfaces::AccessTokenProviderInterface > | accessTokenProvider, | ||
| std::shared_ptr< verification::CardVerifierInterface > | cardVerifier, | ||
| std::function< std::future< RawSignedModel >(RawSignedModel)> | signCallback = nullptr, |
||
| std::shared_ptr< client::CardClientInterface > | cardClient = std::make_shared< client::CardClient >(), |
||
| bool | retryOnUnauthorized = true |
||
| ) |
Constructor.
| crypto | Crypto instance |
| accessTokenProvider | AccessTokenProviderInterface implementation used for getting Access Token when performing queries |
| cardVerifier | CardVerifierInterface implementation used for verifying Cards |
| signCallback | std::function called to perform additional signatures for card before publishing |
| cardClient | CardClientInterface implementation used for performing queries |
| retryOnUnauthorized | will automatically perform second query with forceReload = true AccessToken if true |
| const std::shared_ptr<jwt::interfaces::AccessTokenProviderInterface>& virgil::sdk::cards::CardManager::accessTokenProvider | ( | ) | const |
Getter.
| const std::shared_ptr<client::CardClientInterface>& virgil::sdk::cards::CardManager::cardClient | ( | ) | const |
Getter.
| const std::shared_ptr<verification::CardVerifierInterface>& virgil::sdk::cards::CardManager::cardVerifier | ( | ) | const |
Getter.
| const std::shared_ptr<crypto::Crypto>& virgil::sdk::cards::CardManager::crypto | ( | ) | const |
Getter.
| std::string virgil::sdk::cards::CardManager::exportCardAsBase64 | ( | const Card & | card | ) | const |
| std::string virgil::sdk::cards::CardManager::exportCardAsJson | ( | const Card & | card | ) | const |
| RawSignedModel virgil::sdk::cards::CardManager::exportCardAsRawCard | ( | const Card & | card | ) | const |
|
static |
Generates self signed RawSignedModel.
| crypto | Crypto instance for exporting PublicKey |
| modelSigner | ModelSigner instance for self signing model |
| privateKey | PrivateKey to self sign with |
| publicKey | PublicKey instance |
| identity | identity of Card |
| previousCardId | identifier of Virgil Card with same identity this Card will replace |
| extraFields | std::unordered_map with extra data to sign with model |
| RawSignedModel virgil::sdk::cards::CardManager::generateRawCard | ( | const crypto::keys::PrivateKey & | privateKey, |
| const crypto::keys::PublicKey & | publicKey, | ||
| const std::string & | identity, | ||
| const std::string & | previousCardId = std::string(), |
||
| const std::unordered_map< std::string, std::string > & | extraFields = std::unordered_map< std::string, std::string >() |
||
| ) | const |
Generates self signed RawSignedModel.
| privateKey | PrivateKey to self sign with |
| publicKey | PublicKey instance |
| identity | identity of Card |
| previousCardId | identifier of Virgil Card with same identity this Card will replace |
| extraFields | std::unordered_map with extra data to sign with model |
| std::future<Card> virgil::sdk::cards::CardManager::getCard | ( | const std::string & | cardId | ) | const |
| Card virgil::sdk::cards::CardManager::importCardFromBase64 | ( | const std::string & | base64 | ) | const |
| Card virgil::sdk::cards::CardManager::importCardFromJson | ( | const std::string | json | ) | const |
| Card virgil::sdk::cards::CardManager::importCardFromRawCard | ( | const RawSignedModel & | rawCard | ) | const |
| const ModelSigner& virgil::sdk::cards::CardManager::modelSigner | ( | ) | const |
Getter.
|
static |
| Card virgil::sdk::cards::CardManager::parseCard | ( | const RawSignedModel & | model | ) | const |
| std::future<Card> virgil::sdk::cards::CardManager::publishCard | ( | const RawSignedModel & | rawCard | ) | const |
Asynchronously creates Virgil Card instance on the Virgil Cards Service and associates it with unique identifier Also makes the Card accessible for search/get queries from other users RawSignedModel should be at least selfSigned.
| rawCard | self signed RawSignedModel |
| std::future<Card> virgil::sdk::cards::CardManager::publishCard | ( | const crypto::keys::PrivateKey & | privateKey, |
| const crypto::keys::PublicKey & | publicKey, | ||
| const std::string & | identity = std::string(), |
||
| const std::string & | previousCardId = std::string(), |
||
| const std::unordered_map< std::string, std::string > & | extraFields = std::unordered_map< std::string, std::string >() |
||
| ) | const |
Generates self signed RawSignedModel, asynchronously creates Virgil Card instance on the Virgil Cards Service and associates it with unique identifier.
| privateKey | PrivateKey to self sign RawSignedModel with |
| publicKey | PublicKey instance for generating RawSignedModel |
| identity | identity for generating RawSignedModel. Will be taken from token if omitted |
| previousCardId | identifier of Virgil Card to replace |
| extraFields | std::unordered_map with extra data to sign RawSignedModel with |
| bool virgil::sdk::cards::CardManager::retryOnUnauthorized | ( | ) | const |
Getter.
| std::future<std::vector<Card> > virgil::sdk::cards::CardManager::searchCards | ( | const std::string & | identity | ) | const |
Asynchronously performs search of Virgil Cards using identity on the Virgil Cards Service.
| identity | identity of Card to search |
| const std::function<std::future<RawSignedModel>RawSignedModel)>& virgil::sdk::cards::CardManager::signCallback | ( | ) | const |
Getter.
1.8.10