Knox Tizen Wearable SDK
Password policy group

Password policy gruop provides policies for password control. More...

Data Structures

struct  mdm_password_policy_t
 Password policy. More...
 

Enumerations

Functions

mdm_result_t mdm_set_password_quality (mdm_password_quality_t pwd_quality)
 API to set password quality. More...
 
mdm_result_t mdm_set_password_minimum_length (int value)
 API to set password's minimum length. More...
 
mdm_result_t mdm_set_min_password_complex_chars (int value)
 API to set minimum complex char in password. More...
 
mdm_result_t mdm_set_maximum_failed_password_for_wipe (int value)
 API to set the maximum failed passwords, before device is wiped. More...
 
mdm_result_t mdm_set_password_expires (int value)
 API to set the number of days password expires. More...
 
mdm_result_t mdm_set_password_history (int value)
 API to set the number of previous passwords, that the user cannot use when prompted to change the password. More...
 
mdm_result_t mdm_set_password_pattern (char *p_pattern)
 API to set the required password pattern. More...
 
mdm_result_t mdm_reset_password (char *p_password)
 API to reset password. More...
 
mdm_result_t mdm_enforce_password_change (void)
 API to enforce password change. More...
 
mdm_result_t mdm_set_max_inactivity_time_device_lock (int value)
 API to set the maximum time to lock. More...
 
mdm_result_t mdm_get_max_inactivity_time_device_lock (int *p_value)
 API to get the maximum time to lock. More...
 
mdm_data_tmdm_get_password_policy (void)
 API to get password policy. More...
 
mdm_result_t mdm_delete_password_pattern (void)
 API to remove all password patterns. More...
 
mdm_data_tmdm_get_password_pattern (void)
 API to get password pattern. More...
 
mdm_result_t mdm_set_maximum_character_occurrences (int n_value)
 API to set the maximum number of times a character can occur in the device password. More...
 
mdm_result_t mdm_get_maximum_character_occurrences (int *p_value)
 API to get the maximum number of times a character can occur in the device password. More...
 
mdm_result_t mdm_set_maximum_numeric_sequences_length (int n_value)
 API to set the maximum length of the numeric sequence which is allowed in the device password. More...
 
mdm_result_t mdm_get_maximum_numeric_sequences_length (int *p_value)
 API to get the maximum numeric sequence length allowed in the device password. More...
 
mdm_result_t mdm_set_forbidden_strings (void *p_string_list)
 API to set strings which are forbidden in the device password. More...
 
mdm_data_tmdm_get_forbidden_strings (void)
 API to retrieve the forbidden strings which cannot be used in the device password. More...
 

Detailed Description

Password policy gruop provides policies for password control.

Password policy group provides policies for password control

Required Header

#include <mdm.h>

Overview

This group provides APIs to control the settings related to the device password.

Enumeration Type Documentation

PASSWORD QUALITY.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
See also
mdm_set_password_quality
Enumerator
MDM_PASSWORD_QUALITY_UNSPECIFIED 

No requirements for password.

MDM_PASSWORD_QUALITY_SIMPLE_PASSWORD 

Eas requirement for simple password

MDM_PASSWORD_QUALITY_SOMETHING 

Some kind password is required, but doesn't care what it is

MDM_PASSWORD_QUALITY_NUMERIC 

Containing at least numeric characters

MDM_PASSWORD_QUALITY_ALPHABETIC 

Containing at least alphabetic (or other symbol) characters

MDM_PASSWORD_QUALITY_ALPHANUMERIC 

Containing at least numeric and alphabetic characters

Definition at line 38 of file password.h.

Function Documentation

mdm_result_t mdm_delete_password_pattern ( void  )

API to remove all password patterns.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin removes all password patterns.
mdm_result_t ret = 0;
if (ret == MDM_RESULT_SUCCESS) {
// remove password pattern policy success
} else {
// remove password pattern policy fail
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_set_password_pattern, mdm_get_password_pattern
mdm_result_t mdm_enforce_password_change ( void  )

API to enforce password change.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
The API enforces changing an existing password (or enforces creating a password if the device has none). An administrator can use this API to present to the user a password dialog to change a password or set up a new password.
Remarks
Password status is written into MDM_POLICY_ON_PASSWORD notification file. You can register a callback for this event using mdm_register_policy_receiver.
if (ret == MDM_RESULT_SUCCESS)
{
if (ret == MDM_RESULT_SUCCESS)
{
// Setting password has been completed successfully.
}
else
{
// Setting password has failed.
}
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_set_password_quality
mdm_data_t* mdm_get_forbidden_strings ( void  )

API to retrieve the forbidden strings which cannot be used in the device password.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can retrieve the strings which are forbidden in the device password. Personal data (variations on the user's name, email address or X400 address) are examples of data which can be forbidden. If more than one admin has set this value then the effective forbidden string list is the concatenation of the forbidden strings specified by all admins.
if (lp_data) {
GList *lp_list = (GList *)lp_data->data;
if (lp_list) {
lp_list = g_list_first(lp_list);
while (lp_list && lp_list->data) {
printf("%s", (char *) lp_list->data);
lp_list = g_list_next(lp_list);
}
}
mdm_free_data(lp_data);
}
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
mdm_set_forbidden_strings
mdm_result_t mdm_get_max_inactivity_time_device_lock ( int *  p_value)

API to get the maximum time to lock.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Called by an application that is managing the device to get the value of timeout period.
mdm_result_t ret = 0;
int n_value = 0;
if (ret == MDM_RESULT_SUCCESS)
{
// Operation has been completed successfully.
}
else
{
// Getting password policy has failed.
}
Parameters
[out]p_valueReturned maximum time before locking the device.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
mdm_set_max_inactivity_time_device_lock
mdm_result_t mdm_get_maximum_character_occurrences ( int *  p_value)

API to get the maximum number of times a character can occur in the device password.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can retrieve the maximum number of times a character can occur in the device password. If more than one admin has set this value then the least value will take preference.
int n_value = 0;
if (ret == MDM_RESULT_SUCCESS) {
// get password policy success
int n_num = n_value;
} else {
// get password policy fail
}
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
mdm_set_maximum_character_occurrences
mdm_result_t mdm_get_maximum_numeric_sequences_length ( int *  p_value)

API to get the maximum numeric sequence length allowed in the device password.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can retrieve the length of numeric sequences which are allowed in the device password. For instance, if the return value is '3' then "123", "987", "555" would all be numeric sequences of length '3' and will be allowed in the device password. If more than one admin has set this value then the least value will take preference.
int n_value = 0;
if (ret == MDM_RESULT_SUCCESS) {
// get password policy success
int n_length = n_value;
} else {
// get password policy fail
}
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
See also
mdm_set_maximum_numeric_sequences_length
mdm_data_t* mdm_get_password_pattern ( void  )

API to get password pattern.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This API can be used for applying complexity on new password value.
mdm_data_t * lp_data = NULL;
mdm_password_policy_t *pwd_info = NULL;
if (lp_data != NULL) {
// get password pattern
char *lp_pattern = (char *)lp_data->data;
mdm_free_data(lp_data);
} else {
// set password pattern
}
Returns
mdm_data_t * : mdm_password_policy_t on success, NULL code on error
See also
mdm_set_password_pattern, mdm_delete_password_pattern
mdm_data_t* mdm_get_password_policy ( void  )

API to get password policy.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
This call returns mdm_password_policy_t structure containing the complete description of password policy.
mdm_data_t *lp_data = NULL;
mdm_password_policy_t *pwd_info = NULL;
if (lp_data != NULL)
{
pwd_info = (mdm_password_policy_t *)lp_data->data;
// Using password policy properties.
mdm_free_data(lp_data);
}
else
{
// Getting password policy has failed.
}
Returns
mdm_password_policy_t on success, NULL on failure.
See also
mdm_password_policy_t
mdm_result_t mdm_reset_password ( char *  p_password)

API to reset password.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.3.2.3
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
mdm_reset_password function resets the current password ignoring the restrictions introduced by the following calls:
  • mdm_set_password_history,
  • mdm_set_password_quality,
  • mdm_set_password_minimum_length,
  • mdm_set_password_pattern,
  • mdm_set_maximum_character_occurences,
  • mdm_set_maximum_numeric_sequences_length,
  • mdm_set_forbidden_strings.

The given password must meet 2 conditions:

  • maximum number of attempts has not been exceeded,
  • number of days to expire has not been exceeded.

The current password is not checked.

Remarks
Reset password is signalized by MDM_POLICY_ON_DEVICE_LOCK notification. You can register a callback for this event using mdm_register_policy_receiver.
if (ret == MDM_RESULT_SUCCESS)
{
// Resetting password has been completed successfully.
}
else
{
// Resetting password has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_set_password_history,
mdm_set_password_quality,
mdm_set_password_minimum_length,
mdm_set_password_pattern,
mdm_set_maximum_character_occurrences,
mdm_set_maximum_numeric_sequences_length,
mdm_set_forbidden_strings.
mdm_result_t mdm_set_forbidden_strings ( void *  p_string_list)

API to set strings which are forbidden in the device password.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Called by an admin that is managing the device to set strings that are forbidden to be used in the device password. This specifies any strings which must not be present in the device password such as personal data (variations on the user's name, email address or X400 address), or any other strings. If the parameter list has only one blank string ("") or NULL, then the stored strings are cleared.
GList *lp_List = NULL;
lp_List = g_list_append(lp_List, g_strdup("test"));
lp_List = g_list_append(lp_List, g_strdup("samsung"));
mdm_result_t ret = 0;
if (ret != MDM_RESULT_SUCCESS) {
// set password policy fail
} else {
// set password policy success
}
g_list_foreach((GList *)lp_List, (GFunc)g_free, NULL);
g_list_free((GList *)lp_List);
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Parameters
[in]p_string_listForbidden string list (GList). It might be NULL if one wants to clear the list.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_forbidden_strings
mdm_result_t mdm_set_max_inactivity_time_device_lock ( int  value)

API to set the maximum time to lock.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Called by an application to set the maximum time for user activity until the device will lock. This limits the length that the user can set. It takes effect immediately. The value is rounded up to
  • 15, when 0 < value < 15,
  • 30, when 15 < value < 30,
  • 60, when 30 < value < 60,
  • 120, when 60 < value < 120,
  • 300, when 120 < value < 300,
  • 600, when 300 < value.
if (ret == MDM_RESULT_SUCCESS)
{
// Inactivity time before device locking has been set to 1 min.
}
else
{
// Setting password policy has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Parameters
[in]valueThe new desired maximum time to lock in seconds. A value of 0 means there is no restriction.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_max_inactivity_time_device_lock
mdm_result_t mdm_set_maximum_character_occurrences ( int  n_value)

API to set the maximum number of times a character can occur in the device password.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Called by an admin that is managing the device to specify that any character in the device password cannot occur more than the specified maximum number of times. Characters can be numeric or alphabetic or symbolic. "aaabcde" has 'a' which occurs 3 times, "1b1c1de" has '1' which occurs 3 times and "a@b@c@" has '@' which occurs 3 times. A value of '0' specifies that no restrictions are applied
if (ret == MDM_RESULT_SUCCESS) {
// set password policy success
} else {
// set password policy fail
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_maximum_character_occurrences
mdm_result_t mdm_set_maximum_failed_password_for_wipe ( int  value)

API to set the maximum failed passwords, before device is wiped.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Setting this to a value greater than zero enables a built-in policy, that will perform a device wipe after too many incorrect device-unlock passwords have been entered. If the maximum count is reached, the device will be wiped immediately.
if (ret == MDM_RESULT_SUCCESS)
{
// Setting password policy has been completed successfully.
}
else
{
// Setting password policy has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Parameters
[in]valueThe number of failed password attempts, before the device will wipe its data.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_password_policy
mdm_password_policy_t
mdm_result_t mdm_set_maximum_numeric_sequences_length ( int  n_value)

API to set the maximum length of the numeric sequence which is allowed in the device password.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
API called by MDM admin to set the length of the maximum numerical sequence. A numerical sequence is a set of consecutive integers ordered increasingly (e.g. 4,5,6,7), decreasingly (e.g. 7,6,5,4) or a set of constant integers (e.g. 5,5,5,5). This function specifies that the device password must not contain numerical sequences longer than n_value. E.g. if the maximum value is set to '5' then "123456", "987654" or "555555" are not allowed. '0' argument means that no numerical sequence restriction is imposed.
Warning
On some devices the maximum length of numerical sequences may be fixed and not modifiable.
if (ret == MDM_RESULT_SUCCESS) {
// set password policy success
} else {
// set password policy fail
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Parameters
[in]n_valueMaximum length of numerical sequence.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_maximum_numeric_sequences_length
mdm_result_t mdm_set_min_password_complex_chars ( int  value)

API to set minimum complex char in password.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Called by an application that manages the device to set the minimum number of complex (numbers and symbols) characters in the password. An administrator can configure this setting so as to make the password more secure.
if (ret == MDM_RESULT_SUCCESS)
{
// The password must contain at least 1 symbol or number.
}
else
{
// Setting password's minimum complex chars has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Parameters
[in]valueNumber of complex characters required in the password.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_password_policy
mdm_result_t mdm_set_password_expires ( int  value)

API to set the number of days password expires.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Called by an application that manages the device to set the maximum password age in days after which the password must be changed. An administrator can configure the password age to force the user to enter a new password after every expiration period as a means of enhancing security.
if (ret == MDM_RESULT_SUCCESS)
{
// Setting password policy has been completed successfully.
}
else
{
// Setting password policy has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Parameters
[in]valueNumber of days after which the password expires.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_password_policy
mdm_password_policy_t
mdm_result_t mdm_set_password_history ( int  value)

API to set the number of previous passwords, that the user cannot use when prompted to change the password.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Called by an application that manages the device to set the maximum password history. An administrator can configure the number of previous passwords that cannot be used when entering a new password. This setting enhances security.
if (ret == MDM_RESULT_SUCCESS)
{
// 2 previous passwords cannot be reused as a new password.
}
else
{
// Setting password history has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Parameters
[in]valueNumber of previous passwords, that cannot be used when setting a new password.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_password_policy
mdm_password_policy_t
mdm_result_t mdm_set_password_minimum_length ( int  value)

API to set password's minimum length.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can set the minimum allowed password length. After setting this, the user will not be able to enter a new password that is not at least as restrictive as what has been set. Note that the current password will remain until the user has set a new one, so the change does not take place immediately.
if (ret == MDM_RESULT_SUCCESS)
{
if (ret == MDM_RESULT_SUCCESS)
{
// Setting password policy has been completed successfully.
}
}
else
{
// Setting password policy has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Parameters
[in]valueThe new desired minimum password length. A value of 0 means that there is no restriction.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_password_policy
mdm_password_policy_t
mdm_result_t mdm_set_password_pattern ( char *  p_pattern)

API to set the required password pattern.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Force User to enter password based on a regular expression.
mdm_result_t ret = mdm_set_password_pattern("[a-zA-Z]{4}[0-9]{4}");
if (ret == MDM_RESULT_SUCCESS)
{
// New password pattern has been established.
}
else
{
// Setting password pattern has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Parameters
[in]p_patternRegular expression with password pattern. For example, if regular expression is [a-zA-Z]{4}[0-9]{4}, the administrator can force the user to enter a 8-character password with the first 4 characters alphabetic and next 4 characters numeric.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_delete_password_pattern, mdm_get_password_pattern
mdm_result_t mdm_set_password_quality ( mdm_password_quality_t  pwd_quality)

API to set password quality.

Since (Knox_wearable):
1.0.0
Since (Tizen):
2.2.1.1
Feature:
http://developer.samsung.com/tizen/feature/mdm
Usage:
Admin can set the password restrictions it is imposing. After setting this, the user will not be able to enter a new password that is not at least as restrictive as what has been set.
if (ret == MDM_RESULT_SUCCESS)
{
if (ret == MDM_RESULT_SUCCESS)
{
// Setting password policy has been completed successfully.
}
}
else
{
// Setting password policy has failed.
}
Privilege Level:
public
Privilege:
http://developer.samsung.com/tizen/privilege/mdm.password
Parameters
[in]pwd_qualityThe new desired quality.
Returns
mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
Return values
MDM_RESULT_SUCCESSSuccessful
MDM_RESULT_FAILGeneral failure
MDM_RESULT_NOT_SUPPORTEDNot supported
MDM_RESULT_INVALID_PARAMInvalid parameter
MDM_RESULT_ACCESS_DENIEDThe application does not have the privilege to call this function.
Permission:
Usage of this API is restricted to registered clients only.
See also
mdm_get_password_policy
mdm_password_policy_t
mdm_password_quality_t