public interface Crypto
Encrypt and decrypt data. Sign and verify signature of data. Random generation.
Key pair will generate automatically and saved into key storage on first using
To create implementation use CryptoBuilder
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] encryptedBytes)
Decrypt encrypted data using private key
|
byte[] |
encrypt(byte[] bytes)
Encrypt data using public key
|
java.security.SecureRandom |
rnd()
Gives security random generator
|
byte[] |
sign(byte[] bytes)
Sign data
|
boolean |
verifySignature(byte[] bytes,
byte[] signature)
Verifies signature
|
byte[] encrypt(byte[] bytes)
bytes - data to encryptbyte[] decrypt(byte[] encryptedBytes)
encryptedBytes - encrypted databyte[] sign(byte[] bytes)
bytes - the data to signboolean verifySignature(byte[] bytes,
byte[] signature)
bytes - checking datasignature - verifying signaturetrue - verification is OK, otherwise - verification wrongjava.security.SecureRandom rnd()