}
}
+int ExternalEncryption::verifyPassword(const std::string& password)
+{
+ try {
+ return context->methodCall<int>("ExternalEncryption::verifyPassword",
+ password);
+ } catch (runtime::Exception& e) {
+ return -1;
+ }
+}
+
int ExternalEncryption::changePassword(const std::string& oldPassword,
const std::string& newPassword)
{
}
}
+int InternalEncryption::verifyPassword(const std::string& password)
+{
+ try {
+ return context->methodCall<int>("InternalEncryption::verifyPassword",
+ password);
+ } catch (runtime::Exception& e) {
+ return -1;
+ }
+}
+
int InternalEncryption::changePassword(const std::string& oldPassword,
const std::string& newPassword)
{
return external.decrypt(password);
}
+int ode_external_encryption_verify_password(const char *password, int *result)
+{
+ RET_ON_FAILURE(password, ODE_ERROR_INVALID_PARAMETER);
+ RET_ON_FAILURE(result, ODE_ERROR_INVALID_PARAMETER);
+
+ ODEContext client;
+ RET_ON_FAILURE(client.connect() == 0, ODE_ERROR_CONNECTION_REFUSED);
+ ExternalEncryption external = client.createInterface<ExternalEncryption>();
+ int ret = external.verifyPassword(password);
+
+ RET_ON_FAILURE(ret < 0, ODE_ERROR_INVALID_PARAMETER);
+
+ *result = ret;
+ return ODE_ERROR_NONE;
+}
+
int ode_external_encryption_change_password(const char* old_password,
const char* new_password)
{
ODE_API int ode_external_encryption_get_supported_options(unsigned int* options);
/**
+ * @brief Verify if given password is external encryption password.
+ * @details Administrator can use this API to find if a password is used
+ by external encryption
+ * @since_tizen 3.0
+ * @param[out] password The password to be verified
+ * @return #ODE_ERROR_NONE on success, otherwise a negative value
+ * @retval #ODE_ERROR_NONE Successful
+ * @retval #ODE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ODE_ERROR_TIMED_OUT Time out
+ * @retval #ODE_ERROR_PERMISSION_DENIED The application does not have
+ * the privilege to call this API
+ * @see ode_external_encryption_encrypt()
+ */
+ODE_API int ode_external_encryption_verify_password(const char *password);
+
+/**
* @}
*/
return internal.decrypt(password);
}
+int ode_internal_encryption_verify_password(const char *password, int *result)
+{
+ RET_ON_FAILURE(password, ODE_ERROR_INVALID_PARAMETER);
+ RET_ON_FAILURE(result, ODE_ERROR_INVALID_PARAMETER);
+
+ ODEContext client;
+ RET_ON_FAILURE(client.connect() == 0, ODE_ERROR_CONNECTION_REFUSED);
+ InternalEncryption internal = client.createInterface<InternalEncryption>();
+ int ret = internal.verifyPassword(password);
+
+ RET_ON_FAILURE(ret < 0, ODE_ERROR_INVALID_PARAMETER);
+
+ *result = ret;
+ return ODE_ERROR_NONE;
+}
+
int ode_internal_encryption_change_password(const char* old_password,
const char* new_password)
{
*/
ODE_API int ode_internal_encryption_get_supported_options(unsigned int* options);
+/**
+ * @brief Verify if given password is internal encryption password.
+ * @details Administrator can use this API to find if a password is used
+ by internal encryption
+ * @since_tizen 3.0
+ * @param[out] password The password to be verified
+ * @return #ODE_ERROR_NONE on success, otherwise a negative value
+ * @retval #ODE_ERROR_NONE Successful
+ * @retval #ODE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ODE_ERROR_TIMED_OUT Time out
+ * @retval #ODE_ERROR_PERMISSION_DENIED The application does not have
+ * the privilege to call this API
+ * @see ode_internal_encryption_encrypt()
+ */
+ODE_API int ode_internal_encryption_verify_password(const char *password);
+
/*
* @}
*/
int encrypt(const std::string& password, unsigned int options);
int decrypt(const std::string& password);
+ int verifyPassword(const std::string& password);
int changePassword(const std::string& oldPW, const std::string& newPW);
enum State {
int encrypt(const std::string& password, unsigned int options);
int decrypt(const std::string& password);
+ int verifyPassword(const std::string& password);
int changePassword(const std::string& oldPW, const std::string& newPW);
enum State {
return 0;
}
+int ExternalEncryption::verifyPassword(const std::string& password)
+{
+ KeyManager::data data(password.begin(), password.end());
+ KeyManager keyManager(engine.getKeyMeta());
+
+ if (!keyManager.verifyPassword(data)) {
+ return 1;
+ }
+ return 0;
+}
+
int ExternalEncryption::changePassword(const std::string &oldPassword,
const std::string &newPassword)
{
return 0;
}
+int InternalEncryption::verifyPassword(const std::string& password)
+{
+ KeyManager::data data(password.begin(), password.end());
+ KeyManager keyManager(engine.getKeyMeta());
+
+ if (keyManager.verifyPassword(data)) {
+ return 1;
+ }
+ return 0;
+}
+
int InternalEncryption::changePassword(const std::string& oldPassword,
const std::string& newPassword)
{