public class SoterCore extends java.lang.Object implements ConstantsSoter, SoterErrCode
限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
TAG |
COMMON_SOTER_APP_SECURE_KEY_NAME, ERR_FINGERPRINT_FAIL_MAX, SOTER_COMMON_KEYNAME_PREFIX, SOTER_FINGERPRINT_ERR_FAIL_MAX_MSG, SOTER_PROVIDER_NAME
ERR_ASK_GEN_FAILED, ERR_ASK_NOT_EXIST, ERR_AUTH_KEY_GEN_FAILED, ERR_OK, ERR_PARAMERROR, ERR_REMOVE_ASK, ERR_REMOVE_AUTH_KEY, ERR_SOTER_NOT_SUPPORTED, ERR_UNKNOWN
构造器和说明 |
---|
SoterCore() |
限定符和类型 | 方法和说明 |
---|---|
static SoterSignatureResult |
convertFromBytesToSignatureResult(byte[] origin)
Convert the byte array got from
Signature.sign() to SoterSignatureResult model. |
static SoterCoreResult |
generateAppGlobalSecureKey()
Generate App Secure Key.
|
static SoterCoreResult |
generateAuthKey(java.lang.String authKeyName)
Generate Auth Key.
|
static java.lang.String |
generateRemoteCheckRequestParam()
The parameter represents this device software build.
|
static SoterPubKeyModel |
getAppGlobalSecureKeyModel()
To retrieve the App Secure Key model from device.
|
static java.security.Signature |
getAuthInitAndSign(java.lang.String useKeyAlias)
Prepare the
Signature object before authenticating. |
static SoterPubKeyModel |
getAuthKeyModel(java.lang.String authKeyName)
To retrieve the App Secure Key model from device.
|
static boolean |
hasAppGlobalSecureKey()
Check if there's already a pair of App Secure Key of this application.
|
static boolean |
hasAuthKey(java.lang.String authKeyName)
If there's already a pair of auth key by the given key alias
|
static boolean |
isAuthKeyValid(java.lang.String authKeyName,
boolean autoDelIfNotValid)
Check if the Auth Key is valid or not.
|
static boolean |
isCurrentFingerprintFrozen(android.content.Context context)
Judge whether current fingerprint is frozen due to too many failure trials.
|
static boolean |
isNativeSupportSoter()
Check whether this device supports SOTER by checking native interfaces.
|
static boolean |
isSupportFingerprint(android.content.Context context)
Judge whether there's fingerprint sensor in this device,
|
static boolean |
isSystemHasFingerprint(android.content.Context context)
Judge whether there's any fingerprint enrolled in this device
|
static SoterCoreResult |
removeAppGlobalSecureKey()
Delete the App Secure Key.
|
static SoterCoreResult |
removeAuthKey(java.lang.String authKeyName,
boolean isAutoDeleteASK)
Delete the Auth Key.
|
static void |
setUp()
The prepare work before using SOTER.
|
public static final java.lang.String TAG
public static void setUp()
public static boolean isNativeSupportSoter()
public static SoterCoreResult generateAppGlobalSecureKey()
public static SoterCoreResult removeAppGlobalSecureKey()
public static boolean hasAppGlobalSecureKey()
public static SoterPubKeyModel getAppGlobalSecureKeyModel()
public static SoterCoreResult generateAuthKey(java.lang.String authKeyName)
authKeyName
- The alias of the Auth Key to be generated. Keep in mind it should be unique in each business scene, or the key would be overwrittenpublic static SoterCoreResult removeAuthKey(java.lang.String authKeyName, boolean isAutoDeleteASK)
authKeyName
- The alias of the key to be deletedisAutoDeleteASK
- true if you want to remove the App Secure Key at the same timepublic static boolean hasAuthKey(java.lang.String authKeyName)
authKeyName
- The key alias to checkpublic static boolean isAuthKeyValid(java.lang.String authKeyName, boolean autoDelIfNotValid)
authKeyName
- The alias of the auth key to checkautoDelIfNotValid
- If the auth key should be deleted when find it invalidpublic static SoterPubKeyModel getAuthKeyModel(java.lang.String authKeyName)
authKeyName
- he alias of the auth keypublic static java.security.Signature getAuthInitAndSign(java.lang.String useKeyAlias)
Signature
object before authenticating. You should keep the object for later use after user authenticated.
More over, this method is used for checking whether the auth key is valid or not.useKeyAlias
- The Auth Key alias of which key you want to preparepublic static SoterSignatureResult convertFromBytesToSignatureResult(byte[] origin)
Signature.sign()
to SoterSignatureResult
model.origin
- The return value of Signature.sign()
public static boolean isSupportFingerprint(android.content.Context context)
context
- The contextpublic static boolean isSystemHasFingerprint(android.content.Context context)
context
- The contextpublic static boolean isCurrentFingerprintFrozen(android.content.Context context)
public static java.lang.String generateRemoteCheckRequestParam()