|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.keyczar.Encrypter
org.keyczar.Crypter
public class Crypter
Crypters may both encrypt and decrypt data using sets of symmetric or private
keys. Sets of public keys may only be used with Encrypter
objects.
Constructor Summary | |
---|---|
Crypter(KeyczarReader reader)
Initialize a new Crypter with a KeyczarReader. |
|
Crypter(java.lang.String fileLocation)
Initialize a new Crypter with a key set location. |
Method Summary | |
---|---|
byte[] |
decrypt(byte[] input)
Decrypt the given byte array of ciphertext |
void |
decrypt(java.nio.ByteBuffer input,
java.nio.ByteBuffer output)
Decrypt the given ciphertext input ByteBuffer and write the decrypted plaintext to the output ByteBuffer |
java.lang.String |
decrypt(java.lang.String ciphertext)
Decrypt the given web-safe Base64 encoded ciphertext and return the decrypted plaintext as a String. |
java.lang.String |
toString()
|
Methods inherited from class org.keyczar.Encrypter |
---|
ciphertextSize, encrypt, encrypt, encrypt |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Crypter(KeyczarReader reader) throws KeyczarException
KeyPurpose.DECRYPT_AND_ENCRYPT
.
reader
- A reader to read keys from
KeyczarException
- In the event of an IO error reading keys or if the
key set does not have the appropriate purpose.public Crypter(java.lang.String fileLocation) throws KeyczarException
KeyPurpose.DECRYPT_AND_ENCRYPT
.
fileLocation
- Directory containing a key set
KeyczarException
- In the event of an IO error reading keys or if the
key set does not have the appropriate purpose.Method Detail |
---|
public byte[] decrypt(byte[] input) throws KeyczarException
input
- The input ciphertext
KeyczarException
- If the input is malformed, the ciphertext
signature does not verify, the decryption key is not found, or a JCE
error occurs.public void decrypt(java.nio.ByteBuffer input, java.nio.ByteBuffer output) throws KeyczarException
input
- The input ciphertext. Will not be modified.output
- The output buffer to write the decrypted plaintext
KeyczarException
- If the input is malformed, the ciphertext
signature does not verify, the decryption key is not found, or a JCE
error occurs.public java.lang.String decrypt(java.lang.String ciphertext) throws KeyczarException
ciphertext
- The encrypted ciphertext in web-safe Base64 format
KeyczarException
- If the input is malformed, the ciphertext
signature does not verify, the decryption key is not found, the input is
not web-safe Base64 encoded, or a JCE error occurs.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |