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)
Activate User with provided activation code
switches isReadyToSign to true value |
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 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 |
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,
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,
PCGeneralCallback 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 int |
store(PCUser user,
java.lang.String keyName,
java.lang.String storePassword)
Store / Update User object in storage
User's keys are stored in encrypted state with provided password isReadyToSign must be true If User exists in the storage, then record will be updated In this case keyName, storePassword are optional |
static int |
submitPassword(PCUser user,
java.lang.String password)
Submit password for the User, extracted from storage
switches isReadyToSign to true value |
public static int activate(PCUser user, java.lang.String activationCode)
user
- User objectactivationCode
- Activation codePCError
public static int submitPassword(PCUser user, java.lang.String password)
user
- User objectpassword
- PasswordPCError
public static int store(PCUser user, java.lang.String keyName, java.lang.String storePassword)
user
- User objectkeyName
- User name in storage {store} | New User name in storage {update}storePassword
- Store passwordPCError
public 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 renew(PCUser user, PCGeneralCallback callback)
user
- User objectcallback
- callback
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 java.lang.String getFingerPrint()