public class PCUsersManager
extends java.lang.Object
Constructor and Description |
---|
PCUsersManager() |
Modifier and Type | Method and Description |
---|---|
static int |
activate(PCUser user,
java.lang.String activationCode)
Deprecated.
|
static void |
activate(PCUser user,
java.lang.String activationCode,
PCActivateCallback callback)
Activates the user with provided activation code.
|
static boolean |
delete(PCUser user)
Removes user from the storage.
|
static PCUser |
getById(java.lang.String userId)
Returns user from storage by it's id
|
static void |
getCertificateInfo(PCUser user,
PCGetCertificateInfoCallback callback)
Extracts information about user's certificate from PC Server
|
static java.lang.String |
getFingerPrint()
Generate device fingerprint
|
static void |
getScoringSettings(PCUser user,
PCGetScoringSettingsCallback callback)
Gets Scoring settings from PC Server.
|
static PCUser |
importUser(java.lang.String source)
Create User object by input string (storageID, QR-code value, JSON-value, XML-value, Deep Link value)
|
static java.util.List<PCUser> |
listStorage()
List users in the storage
|
static void |
migrate(java.lang.String source,
java.lang.String name,
java.lang.String password,
java.security.cert.Certificate certificate,
PCMigrationCallback callback)
Performs migration of the key from PCSDK 4 to the current version of PCSDK.
The prerequisites to calling this method are the following: Both PCSDK 4 and the current PCSDK are embedded into the same application The key being migrated is active in PCSDK 4 (i.e., accessible via PCSDK 4 methods, not expired) The given value of source and the certificate are obtained from PCSDK 4 method PCKey.exportRawWithCertificate(...). The given value of password is the same as was used in PCSDK 4 Note that after the successful migration the key will present in both the current PCSDK and PCSDK 4. |
static void |
register(PCUser user,
java.lang.String pushID,
PCNetCallback callback)
Register User and device on PCSDK Server
Following actions will be executed: - generate key pair (if required) - register public key (if new key pair was generated) - check if push address was changed - register new push address (if required) - calculate device fingerprint (if required) - register device fingerprint (if required) |
static void |
register(PCUser user,
java.lang.String pushID,
PCPushServiceType pushServiceType,
PCKeysProcessor keysProcessor,
PCRegisterCallback callback) |
static void |
register(PCUser user,
java.lang.String pushID,
PCPushServiceType pushServiceType,
PCNetCallback callback)
Register User and device on PCSDK Server
Following actions will be executed: - generate key pair (if required) - register public key (if new key pair was generated) - check if push address was changed - register new push address (if required) - calculate device fingerprint (if required) - register device fingerprint (if required) |
static void |
registerExtAuthTemplate(PCUser user,
PCExtendedAuth extAuth,
PCNetCallback callback)
Register Extended authentication template on PCSDK Server
|
static void |
renew(PCUser user,
PCKeysProcessor keysProcessor,
PCRenewCallback callback)
Renew User's keys
When User's keys expiration date is close, keys should be renewed This function renews User's keys automatically with existing User's keys Existing keys MUST be not expired |
static void |
renew(PCUser user,
PCRenewCallback callback)
Renew User's keys
|
static int |
store(PCUser user,
java.lang.String keyName,
java.lang.String password)
Deprecated.
|
static void |
store(PCUser user,
java.lang.String keyName,
java.lang.String password,
PCStoreCallback callback)
Stores a new user or updates an existing object in storage.
User's keys are encrypted with provided password before being stored. If new user is being stored, condition PCUser.isReadyToAutoSign() == true must be satisfied. |
static int |
submitPassword(PCUser user,
java.lang.String password)
Deprecated.
|
static void |
submitPassword(PCUser user,
java.lang.String password,
PCSubmitPasswordCallback callback)
Submits password for the target
PCUser , extracted from storage.Switches PCUser.isReadyToAutoSign() to true.In case PCUser.areOnlineCredentialsRequired() returns true, this method performs a network request
and the passed callback is invoked asynchronously with some delay. |
@Deprecated public static int activate(PCUser user, java.lang.String activationCode)
importUser(String)
if PCUser.isActivated()
returns false.PCUser.isReadyToAutoSign()
to true.PCUser.areOnlineCredentialsRequired()
returns false. For universal case use activate(PCUser, String, PCActivateCallback)
user
- Target PCUser
activationCode
- Activation codePCError
. PCError.PC_ERROR_OK
is returned upon a success.activate(PCUser, String, PCActivateCallback)
public static void activate(PCUser user, java.lang.String activationCode, PCActivateCallback callback)
importUser(String)
if PCUser.isActivated()
returns false.PCUser.isReadyToAutoSign()
to true.PCUser.areOnlineCredentialsRequired()
returns true, this method performs a network request
and the passed callback is invoked asynchronously with some delay. Otherwise, the callback is invoked immediatelyuser
- Target PCUser
activationCode
- The submitted activation codecallback
- Implementation of PCActivateCallback
to handle results@Deprecated public static int submitPassword(PCUser user, java.lang.String password)
PCUser
, extracted from storage.PCUser.isReadyToAutoSign()
to true.PCUser.areOnlineCredentialsRequired()
returns false. For universal case use submitPassword(PCUser, String, PCSubmitPasswordCallback)
user
- Target PCUser
password
- Provided passwordPCError
. PCError.PC_ERROR_OK
is returned upon a success.submitPassword(PCUser, String, PCSubmitPasswordCallback)
public static void submitPassword(PCUser user, java.lang.String password, PCSubmitPasswordCallback callback)
PCUser
, extracted from storage.PCUser.isReadyToAutoSign()
to true.PCUser.areOnlineCredentialsRequired()
returns true, this method performs a network request
and the passed callback is invoked asynchronously with some delay. Otherwise, the callback is invoked immediatelyuser
- Target PCUser
password
- Provided passwordcallback
- Implementation of PCSubmitPasswordCallback
for handling results@Deprecated public static int store(PCUser user, java.lang.String keyName, java.lang.String password)
PCUser.isReadyToAutoSign()
== true must be satisfied. The
same is required if the existing user is being updated with a new password.
This method is deprecated but still can be used for keys for which PCUser.areOnlineCredentialsRequired()
returns false. For universal case use store(PCUser, String, String, PCStoreCallback)
user
- Target PCUser
keyName
- Unique key name. When storing user for the first time, it must not be null. If it is not null
when the user is already exists, the name will be changed in storage.password
- Password which will be used to encrypt keys in storage. It can be null when the user has
already been stored and the method is called with non-null keyName only for changing
name.PCError
. PCError.PC_ERROR_OK
is returned upon a success.store(PCUser, String, String)
public static void store(PCUser user, java.lang.String keyName, java.lang.String password, PCStoreCallback callback)
PCUser.isReadyToAutoSign()
== true must be satisfied. The
same is required if the existing user is being updated with a new password.
In case PCUser.areOnlineCredentialsRequired()
returns true, this method performs a network request
and the passed callback is invoked asynchronously with some delay. Otherwise, the callback is invoked immediatelyuser
- Target PCUser
keyName
- Unique key name. When storing user for the first time, it must not be null. If it is not null
when the user is already exists, the name will be changed in storage.password
- Password which will be used to encrypt keys in storage. It can be null when the user has
already been stored and the method is called with non-null keyName only for changing
name.callback
- Implementation of PCStoreCallback
for handling resultspublic static void register(PCUser user, java.lang.String pushID, PCNetCallback callback)
user
- User objectpushID
- Firebase push tokencallback
- callback function to process results
PCNetCallback
public static void register(PCUser user, java.lang.String pushID, PCPushServiceType pushServiceType, PCNetCallback callback)
user
- Target PCUser
objectpushID
- Push tokenpushServiceType
- Type of service used for receiving push notifications. Supported services are Firebase
and HMScallback
- PCNetCallback
to process resultspublic static void register(PCUser user, java.lang.String pushID, PCPushServiceType pushServiceType, PCKeysProcessor keysProcessor, PCRegisterCallback callback)
public static void renew(PCUser user, PCRenewCallback callback)
user
- User objectcallback
- PCGeneralCallback
for handling resultsrenew(PCUser, PCKeysProcessor, PCRenewCallback)
public static void renew(PCUser user, PCKeysProcessor keysProcessor, PCRenewCallback callback)
user
- User objectkeysProcessor
- Instance of keys processorcallback
- PCGeneralCallback
public static void registerExtAuthTemplate(PCUser user, PCExtendedAuth extAuth, PCNetCallback callback)
user
- User objectextAuth
- Extended authentication datacallback
- callback
PCNetCallback
public static void getCertificateInfo(PCUser user, PCGetCertificateInfoCallback callback)
user
- Target PCUser
objectcallback
- PCGetCertificateInfoCallback
for handling resultspublic static PCUser getById(java.lang.String userId)
userId
- ID of userPCUser
object or null if user with such id is not foundpublic static java.util.List<PCUser> listStorage()
public static boolean delete(PCUser user)
user
- User objectpublic static PCUser importUser(java.lang.String source)
source
- User data or identifierpublic static void migrate(java.lang.String source, java.lang.String name, java.lang.String password, java.security.cert.Certificate certificate, PCMigrationCallback callback)
source
- The key info exported by PCSDK 4 in compatible format, i.e., either XML or multi-line plaintextname
- The desired name of the PCUser to be created. Can be same as returned by PCKey.getKeyName() in PCSDK 4password
- The password used in PCSDK 4 to protect the keycertificate
- Self-signed certificate generated by PCSDK 4callback
- Instance of PCMigrationCallback
to handle the resultspublic static java.lang.String getFingerPrint()
public static void getScoringSettings(PCUser user, PCGetScoringSettingsCallback callback)
user
- Target PCUser
callback
- Instance of PCGetScoringSettingsCallback
for handling results