/* * CERT_LicenseFile.h * * Created by Andrew Salamon on 9/15/08. * Copyright 2008 Machine Perception Laboratory, University of California San Diego. All rights reserved. * */ #ifndef __CERT_LICENSEFILE_H__ #define __CERT_LICENSEFILE_H__ #include "Cert_License.h" #include "CERT_LicenseVerifier.h" namespace CERT { class LicenseFile { public: LicenseFile( const std::string &privateKeyPath ); bool parseFile( const std::string &filename ); bool parseStream( std::istream &istr ); bool writeToFile( const std::string &filename ); bool writeToStream( std::ostream &ostr ); License &getLicense(); void setLicense( License &_license ); bool isValid() { return valid; } private: License license; LicenseVerifier verifier; bool valid; bool validateLicense( const std::string &cyphertext ); }; } // end namespace CERT #endif