public class SpenNoteFileSignature extends Object
| Constructor and Description |
|---|
SpenNoteFileSignature(Context context,
String filePath)
Create a SpenNoteFileSignature instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getRegisteredCount()
Get the number of registered signature.
|
static boolean |
isLocked(String filePath)
Check whether the file is locked(encrypted) by signature or not.
|
void |
lock()
Lock(encrypt) the specified file with registered signature.
You should register at least 3 signatures to lock the file. |
void |
register(ArrayList<SpenObjectBase> signature)
Register a signature.
You should register at least 3 signatures to lock the file with signature. |
void |
resetRegister()
Reset signature engine to register.
|
void |
unlock(ArrayList<SpenObjectBase> signature)
Unlock(decrypt) the specified file which is locked by signature.
|
public SpenNoteFileSignature(Context context, String filePath)
context - The Context for your application.filePath - The absolute path of the file to lock or unlock.IllegalArgumentException - Thrown if context or filePath is null.IllegalStateException - Thrown if it is failed to load signature librariespublic void resetRegister()
register(ArrayList)public void register(ArrayList<SpenObjectBase> signature) throws IllegalArgumentException
signature - The strokes of signatureIllegalArgumentException - Thrown if signature is null or has any object which is not an SpenObjectStroke.
Or, if an SpenObjectStroke doens't have orientations or tilts information.resetRegister(),
getRegisteredCount()public int getRegisteredCount()
register(ArrayList)public void lock()
throws IOException,
SpenUnsupportedTypeException
IOException - Thrown if the file which is you set when you create this instance is not found, or if a temporary
directory cannot be created.SpenUnsupportedTypeException - Thrown if the file is not in SPD file format.IllegalArgumentException - Thrown if the file which is you set when you create this instance is locked already.IllegalStateException - Thrown if the number of registered signatures is not enough.register(ArrayList),
unlock(ArrayList)public void unlock(ArrayList<SpenObjectBase> signature) throws IOException, SpenInvalidPasswordException, SpenUnsupportedTypeException
signature - The signature to unlock the file.IOException - Thrown if the cache directory cannot be created or the file is not found.SpenInvalidPasswordException - Thrown if the signature is wrong.SpenUnsupportedTypeException - Thrown if the file is not in SPD file format.IllegalArgumentException - Thrown if signature is null or has any object which is not an SpenObjectStroke.
Or, if an SpenObjectStroke doens't have orientations or tilts information.lock(),
isLocked(String)public static boolean isLocked(String filePath)
filePath - The absolute path of the file.true, if the file is locked by signature.false, if the file is not locked by
signature.IllegalStateException - Thrown if it is failed to load signature librarieslock(),
unlock(ArrayList)