|
aerogear-crypto 0.1.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.aerogear.crypto.CryptoBox
public class CryptoBox
Class responsible for box and unbox crypto messages given the key
| Field Summary | |
|---|---|
private byte[] |
authData
|
private org.bouncycastle.crypto.modes.AEADBlockCipher |
cipher
|
private byte[] |
key
|
| Constructor Summary | |
|---|---|
CryptoBox(byte[] key)
Initializes the box providing the secret key |
|
CryptoBox(PrivateKey key)
Initializes the box providing the secret key |
|
CryptoBox(PrivateKey privateKey,
PublicKey publicKey)
Initializes the box providing the key pair for asymmetric encryption |
|
CryptoBox(String key,
Encoder encoder)
Initializes the box providing the secret key and encoder |
|
| Method Summary | |
|---|---|
byte[] |
decrypt(byte[] IV,
byte[] cipherText)
Given the IV, decrypt the provided data |
byte[] |
decrypt(String IV,
String cipherText,
Encoder encoder)
Given the IV, decrypt the provided data |
byte[] |
encrypt(byte[] IV,
byte[] message)
Given the IV, encrypt the provided data |
byte[] |
encrypt(String IV,
String message,
Encoder encoder)
Given the IV, encrypt and encode the provided data |
private byte[] |
generateSecret(PrivateKey privateKey,
PublicKey publicKey)
|
void |
updateAAD(byte[] authData)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private byte[] key
private org.bouncycastle.crypto.modes.AEADBlockCipher cipher
private byte[] authData
| Constructor Detail |
|---|
public CryptoBox(byte[] key)
key - byte arraypublic CryptoBox(PrivateKey key)
key - reference to the PrivateKey
public CryptoBox(String key,
Encoder encoder)
key - encoder -
public CryptoBox(PrivateKey privateKey,
PublicKey publicKey)
privateKey - publicKey - | Method Detail |
|---|
private byte[] generateSecret(PrivateKey privateKey,
PublicKey publicKey)
public byte[] encrypt(byte[] IV,
byte[] message)
throws RuntimeException
IV - initialization vectormessage - data to be encrypted
RuntimeException
public byte[] encrypt(String IV,
String message,
Encoder encoder)
IV - initialization vectormessage - data to be encryptedencoder - encoder provided RAW or HEX
public byte[] decrypt(byte[] IV,
byte[] cipherText)
throws RuntimeException
IV - initialization vectorcipherText - data to be decrypted
RuntimeException
public byte[] decrypt(String IV,
String cipherText,
Encoder encoder)
IV - initialization vectorcipherText - data to be decryptedencoder - encoder provided RAW or HEX
public void updateAAD(byte[] authData)
|
aerogear-crypto 0.1.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||