Tizen Native API
5.0
|
Password policy group provides APIs to control password policies.
#include <dpm/password.h>
Password policy group provides APIs to control password policies such as password type, password quality and expiration date. Any API which requires privileges is only available for the registered device admin client which is enrolled to the device by enrollment process.
Functions | |
int | dpm_password_set_quality (device_policy_manager_h handle, int quality) |
Sets password quality. | |
int | dpm_password_get_quality (device_policy_manager_h handle, int *quality) |
Gets password quality. | |
int | dpm_password_set_minimum_length (device_policy_manager_h handle, int value) |
Sets password minimum length. | |
int | dpm_password_get_minimum_length (device_policy_manager_h handle, int *value) |
Gets password minimum length. | |
int | dpm_password_set_min_complex_chars (device_policy_manager_h handle, int value) |
Sets minimum complex char in password. | |
int | dpm_password_get_min_complex_chars (device_policy_manager_h handle, int *value) |
Gets minimum complex char in password. | |
int | dpm_password_set_maximum_failed_attempts_for_wipe (device_policy_manager_h handle, int value) |
Sets maximum number of failed attempts before device is wiped. | |
int | dpm_password_get_maximum_failed_attempts_for_wipe (device_policy_manager_h handle, int *value) |
Gets maximum number of failed attempts before device is wiped. | |
int | dpm_password_set_expires (device_policy_manager_h handle, int value) |
Sets the number of days password expires. | |
int | dpm_password_get_expires (device_policy_manager_h handle, int *value) |
Gets the number of days password expires. | |
int | dpm_password_set_history (device_policy_manager_h handle, int value) |
Sets the number of min password history to avoid previous password. | |
int | dpm_password_get_history (device_policy_manager_h handle, int *value) |
Gets the number of min password history to avoid previous password. | |
int | dpm_password_set_pattern (device_policy_manager_h handle, const char *pattern) |
Sets the required password pattern. | |
int | dpm_password_reset (device_policy_manager_h handle, const char *password) |
Resets password. | |
int | dpm_password_enforce_change (device_policy_manager_h handle) |
Enforces password change. | |
int | dpm_password_set_max_inactivity_time_device_lock (device_policy_manager_h handle, int value) |
Sets the maximum number of seconds of inactivity time before the screen timeout occurs. | |
int | dpm_password_get_max_inactivity_time_device_lock (device_policy_manager_h handle, int *value) |
Gets the maximum number of seconds of inactivity time before the screen timeout occurs. | |
int | dpm_password_set_status (device_policy_manager_h handle, dpm_password_status_e status) |
Sets password status. | |
int | dpm_password_get_status (device_policy_manager_h handle, dpm_password_status_e *status) |
Gets password status. | |
int | dpm_password_delete_pattern (device_policy_manager_h handle) |
Removes all password patterns. | |
int | dpm_password_get_pattern (device_policy_manager_h handle, char **pattern) |
Gets password pattern. | |
int | dpm_password_set_maximum_character_occurrences (device_policy_manager_h handle, int value) |
Sets the maximum number of times a character can occur in the device password. | |
int | dpm_password_get_maximum_character_occurrences (device_policy_manager_h handle, int *value) |
Gets the maximum number of times a character can occur in the device password. | |
int | dpm_password_set_maximum_numeric_sequence_length (device_policy_manager_h handle, int value) |
Sets the maximum length of the numeric sequence which is allowed in the device password. | |
int | dpm_password_get_maximum_numeric_sequence_length (device_policy_manager_h handle, int *value) |
Gets the maximum numeric sequence length allowed in the device password. | |
dpm_password_iterator_h | dpm_password_create_iterator (device_policy_manager_h handle) |
Creates a password forbidden string list iterator. | |
int | dpm_password_iterator_next (dpm_password_iterator_h iter, const char **forbidden_string) |
Fetches a password forbidden string and forwards the iterator. | |
int | dpm_password_destroy_iterator (dpm_password_iterator_h iter) |
Frees the password forbidden string iterator. | |
int | dpm_password_set_forbidden_strings (device_policy_manager_h handle, const char *strings[], int length) |
Sets strings which are forbidden in the device password. | |
Typedefs | |
typedef void * | dpm_password_iterator_h |
The password forbidden string list iterator handle. |
typedef void* dpm_password_iterator_h |
The password forbidden string list iterator handle.
Enumeration for dpm password quality type.
Enumeration for dpm password status type.
Creates a password forbidden string list iterator.
The password forbidden string list iterator can be used to get all forbidden strings.
[in] | handle | Device policy manager handle |
DPM_ERROR_NONE | No error |
DPM_ERROR_OUT_OF_MEMORY | Out of memory |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_delete_pattern | ( | device_policy_manager_h | handle | ) |
Removes all password patterns.
An administrator can remove all password patterns.
[in] | handle | Device policy manager handle |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_destroy_iterator | ( | dpm_password_iterator_h | iter | ) |
Frees the password forbidden string iterator.
This API frees the password forbidden string iterator. This API must be called if the iterator no longer used.
[in] | iter | The iterator to be removed |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_enforce_change | ( | device_policy_manager_h | handle | ) |
Enforces password change.
An administrator can enforce password change. PasswordPolicy change setting is launched.
[in] | handle | Device policy manager handle |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_get_expires | ( | device_policy_manager_h | handle, |
int * | value | ||
) |
Gets the number of days password expires.
An administrator can get the password age to force the user to enter a new password after every expiration period.
[in] | handle | Device policy manager handle |
[out] | value | Number of days after which the password expires. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_get_history | ( | device_policy_manager_h | handle, |
int * | value | ||
) |
Gets the number of min password history to avoid previous password.
An administrator can get the number of previous passwords which cannot be used when entering a new password.
[in] | handle | Device policy manager handle |
[out] | value | Number of previous passwords which cannot be used when settings a new password. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_get_max_inactivity_time_device_lock | ( | device_policy_manager_h | handle, |
int * | value | ||
) |
Gets the maximum number of seconds of inactivity time before the screen timeout occurs.
Called by an application that is managing the device to get the value of timeout period.
[in] | handle | Device policy manager handle |
[out] | value | Pointer of Maximum inactivity time for device lock. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_get_maximum_character_occurrences | ( | device_policy_manager_h | handle, |
int * | value | ||
) |
Gets the maximum number of times a character can occur in the device password.
An administrator 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.
[in] | handle | Device policy manager handle |
[out] | value | Pointer of Maximum Character Occurrences |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_get_maximum_failed_attempts_for_wipe | ( | device_policy_manager_h | handle, |
int * | value | ||
) |
Gets maximum number of failed attempts before device is wiped.
If user fails the last attempt, device will be wiped.
[in] | handle | Device policy manager handle |
[out] | value | Maximum count for failed passwords. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_get_maximum_numeric_sequence_length | ( | device_policy_manager_h | handle, |
int * | value | ||
) |
Gets the maximum numeric sequence length allowed in the device password.
An administrator 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.
[in] | handle | Device policy manager handle |
[out] | value | Pointer of maximum numeric sequence length |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_get_min_complex_chars | ( | device_policy_manager_h | handle, |
int * | value | ||
) |
Gets minimum complex char in password.
Complex characters are all non-alphabetic characters; that is, numbers and symbols.
[in] | handle | Device policy manager handle |
[out] | value | Number of minimum complex char in password. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_get_minimum_length | ( | device_policy_manager_h | handle, |
int * | value | ||
) |
Gets password minimum length.
Gets the minimum allowed password length.
[in] | handle | Device policy manager handle |
[out] | value | Allowed minimum password length |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_get_pattern | ( | device_policy_manager_h | handle, |
char ** | pattern | ||
) |
Gets password pattern.
This API can be used for applying complexity on new password value.
[in] | handle | Device policy manager handle |
[out] | pattern | Password pattern |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_OUT_OF_MEMORY | Out of memory |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_get_quality | ( | device_policy_manager_h | handle, |
int * | quality | ||
) |
Gets password quality.
An administrator can get the password restrictions it is imposing.
[in] | handle | Device policy manager handle |
[out] | quality | Password quality type, values of dpm_password_quality_e combined with bitwise 'or' |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_get_status | ( | device_policy_manager_h | handle, |
dpm_password_status_e * | status | ||
) |
Gets password status.
An administrator can know password status for this API.
[in] | handle | Device policy manager handle |
[out] | status | Password status |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
int dpm_password_iterator_next | ( | dpm_password_iterator_h | iter, |
const char ** | forbidden_string | ||
) |
Fetches a password forbidden string and forwards the iterator.
This API returns a password forbidden string indicated by the iterator, and then the iterator is moved to the next position. If the iterator reaches the end of the list, null value will be returned.
[in] | iter | The iterator to be controlled |
[out] | forbidden_string | The forbidden string got from the iterator |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
int dpm_password_reset | ( | device_policy_manager_h | handle, |
const char * | password | ||
) |
Resets password.
This takes effect immediately to the device password.
[in] | handle | Device policy manager handle |
[in] | password | New password |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_set_expires | ( | device_policy_manager_h | handle, |
int | value | ||
) |
Sets the number of days password expires.
An administrator can configure the password age to force the user to enter a new password after every expiration period.
[in] | handle | Device policy manager handle |
[in] | value | Number of days after which the password expires. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_set_forbidden_strings | ( | device_policy_manager_h | handle, |
const char * | strings[], | ||
int | length | ||
) |
Sets strings which are forbidden in the device password.
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(""), then the stored strings are cleared.
[in] | handle | Device policy manager handle |
[in] | strings | The forbidden strings |
[in] | length | The length of the strings |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_set_history | ( | device_policy_manager_h | handle, |
int | value | ||
) |
Sets the number of min password history to avoid previous password.
An administrator can configure the number of previous passwords which cannot be used when entering a new password.
[in] | handle | Device policy manager handle |
[in] | value | Number of previous passwords which cannot be used when settings a new password. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_set_max_inactivity_time_device_lock | ( | device_policy_manager_h | handle, |
int | value | ||
) |
Sets the maximum number of seconds of inactivity time before the screen timeout occurs.
An administrator sets the maximum number of seconds of inactivity time before the screen timeout occurs and a device user must type the password to unlock the device.
[in] | handle | Device policy manager handle |
[in] | value | Maximum inactivity time for device lock. Specifies how soon the device can be unlocked again after use, without reprompting for the passcode. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_set_maximum_character_occurrences | ( | device_policy_manager_h | handle, |
int | value | ||
) |
Sets the maximum number of times a character can occur in the device password.
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.
[in] | handle | Device policy manager handle |
[in] | value | Maximum character occurrences |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_set_maximum_failed_attempts_for_wipe | ( | device_policy_manager_h | handle, |
int | value | ||
) |
Sets maximum number of failed attempts before device is wiped.
If user fails the last attempt, device will be wiped.
[in] | handle | Device policy manager handle |
[in] | value | Maximum count for failed passwords. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_set_maximum_numeric_sequence_length | ( | device_policy_manager_h | handle, |
int | value | ||
) |
Sets the maximum length of the numeric sequence which is allowed in the device password.
Called by an administrator that is managing the device to set the maximum numeric sequence length. This specifies that the device password must not contain numeric sequences greater than the given length. Numeric sequences can be increasing successively by one like "12345", or decreasing successively by one like "98765", or repeating like "55555". These are all numeric sequences of length '5'. If maximum value is set to '5' then "123456" or "987654" or "555555" are not allowed. A value of '0' specifies that no such numeric sequence restrictions are applied.
[in] | handle | Device policy manager handle |
[in] | value | Maximum numeric sequence length |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_set_min_complex_chars | ( | device_policy_manager_h | handle, |
int | value | ||
) |
Sets minimum complex char in password.
Complex characters are all non-alphabetic characters; that is, numbers and symbols. Admin can configure this setting and make the password more secure.
[in] | handle | Device policy manager handle |
[in] | value | Number of minimum complex char in password. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_set_minimum_length | ( | device_policy_manager_h | handle, |
int | value | ||
) |
Sets password minimum length.
Sets the minimum allowed password length. After setting this, the user will not be able to enter a new password that is shorter than the setting length.
[in] | handle | Device policy manager handle |
[in] | value | Allowed minimum password length |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_set_pattern | ( | device_policy_manager_h | handle, |
const char * | pattern | ||
) |
Sets the required password pattern.
An administrator can force User to enter password based on a regular expression.
[in] | handle | Device policy manager handle |
[in] | pattern | Password pattern. If regular expression is [a-zA-Z]{4}[0-9]{4}, we can force user to enter a 8 character password with first 4 alphabetic characters and next 4 numeric characters. An administrator must take care when setting this pattern. |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_set_quality | ( | device_policy_manager_h | handle, |
int | quality | ||
) |
Sets password quality.
An administrator 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.
[in] | handle | Device policy manager handle |
[in] | quality | Password quality type, values of dpm_password_quality_e combined with bitwise 'or' |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |
int dpm_password_set_status | ( | device_policy_manager_h | handle, |
dpm_password_status_e | status | ||
) |
Sets password status.
An administrator can know password status for this API.
[in] | handle | Device policy manager handle |
[in] | status | Password status |
DPM_ERROR_NONE | Successful |
DPM_ERROR_INVALID_PARAMETER | Invalid parameter |
DPM_ERROR_TIMED_OUT | Time out |
DPM_ERROR_PERMISSION_DENIED | The application does not have the privilege to call this API |