java.lang.Object |
↳ |
com.kinvey.android.secure.Crypto |
Class Overview
This class offers publicly accessible methods for handling on-device encryption of arbitrary strings.
It assumes Keys are stored locally, which are managed by the version dependant KeyStore
This class applies the PRNG fixes recommended by Google to handle possible low entropy in /dev/urandom
Summary
Public Methods |
final
static
String
|
decrypt(String data)
Public wrapper method to decrypt a string, will load key
|
static
InputStream
|
decryptInputStream(CipherInputStream stream)
|
static
OutputStream
|
decryptOutputStream(CipherOutputStream stream)
|
static
void
|
deleteKeys()
|
final
static
String
|
encrypt(String text)
Public wrapper method to encrypt a string
|
static
CipherInputStream
|
encryptInputStream(InputStream stream)
|
static
CipherOutputStream
|
encryptOutputStream(OutputStream stream)
|
static
String
|
toHex(byte[] stringBytes)
|
[Expand]
Inherited Methods |
From class
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Public Constructors
Public Methods
public
static
final
String
decrypt
(String data)
Public wrapper method to decrypt a string, will load key
Parameters
data |
the encrypted string to decrypt |
Returns
- a decrypted version of the string
public
static
InputStream
decryptInputStream
(CipherInputStream stream)
public
static
OutputStream
decryptOutputStream
(CipherOutputStream stream)
public
static
void
deleteKeys
()
public
static
final
String
encrypt
(String text)
Public wrapper method to encrypt a string
Parameters
text |
the string to encrypt |
public
static
CipherInputStream
encryptInputStream
(InputStream stream)
public
static
CipherOutputStream
encryptOutputStream
(OutputStream stream)
public
static
String
toHex
(byte[] stringBytes)