#include <string>

namespace Signing {

int FivePush(const std::string& src, bool isPaUser=false);

/**
 * @brief Set extended attribute to file on device
 * @param [in] file Path to file on device
 * @param [in] name Xattr name
 * @param [in] b64_xattr Base64-encoded value
 * @return 0 if success
 */
int SetXattr(const std::string& file, const std::string& name, const std::string& b64_xattr);

/**
 * @brief Get extended attribute from file on device
 * @param [in] file Path to file on device
 * @param [in] name Xattr name
 * @param [out] b64_xattr Base64-encoded value
 * @return 0 if success
 */
int GetXattr(const std::string& file, const std::string& name, std::string& b64_xattr);

/**
 * @brief Generate PA signature for native application
 * @param [in] path Path on device (e.g. /system/bin/canary)
 * @param [in] five Base64-encoded FIVE signature
 * @param [out] signature PA signature
 * @return 0 if success
 */
int PaNativeSignature(const std::string& path, const std::string& five, std::string& signature);

/**
 * @brief Generate PA signature for Android application
 * @param [in] package Package name (e.g. com.samsung.paclient)
 * @param [in] five Base64-encoded FIVE signature
 * @param [out] signature PA signature
 * @note Platform system RSA key will be used
 * @return 0 if success
 */
int PaAndroidSignature(const std::string& package, const std::string& five, std::string& signature);

}
