|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.owasp.esapi.reference.JSEEncryptor
Reference implementation of the IEncryptor interface. This implementation layers on the JCE provided cryptographic package. Algorithms used are configurable in the ESAPI.properties file.
Encryptor| Constructor Summary | |
JSEEncryptor()
|
|
| Method Summary | |
java.lang.String |
decrypt(java.lang.String ciphertext)
Decrypts the provided ciphertext string (encrypted with the encrypt method) and returns a plaintext string. |
java.lang.String |
encrypt(java.lang.String plaintext)
Encrypts the provided plaintext and returns a ciphertext string. |
long |
getRelativeTimeStamp(long offset)
Gets an absolute timestamp representing an offset from the current time to be used by other functions in the library. |
long |
getTimeStamp()
Gets a timestamp representing the current date and time to be used by other functions in the library. |
java.lang.String |
hash(java.lang.String plaintext,
java.lang.String salt)
Hashes the data using the specified algorithm and the Java MessageDigest class. |
java.lang.String |
seal(java.lang.String data,
long expiration)
Creates a seal that binds a set of data and includes an expiration timestamp. |
java.lang.String |
sign(java.lang.String data)
Create a digital signature for the provided data and return it in a string. |
java.lang.String |
unseal(java.lang.String seal)
Unseals data (created with the seal method) and throws an exception describing any of the various problems that could exist with a seal, such as an invalid seal format, expired timestamp, or decryption error. |
boolean |
verifySeal(java.lang.String seal)
Verifies a seal (created with the seal method) and throws an exception describing any of the various problems that could exist with a seal, such as an invalid seal format, expired timestamp, or data mismatch. |
boolean |
verifySignature(java.lang.String signature,
java.lang.String data)
Verifies a digital signature (created with the sign method) and returns the boolean result. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JSEEncryptor()
| Method Detail |
public java.lang.String hash(java.lang.String plaintext,
java.lang.String salt)
throws EncryptionException
hash in interface Encryptorplaintext - the plaintextsalt - the salt
EncryptionException - the encryption exceptionEncryptor.hash(java.lang.String,java.lang.String)
public java.lang.String encrypt(java.lang.String plaintext)
throws EncryptionException
Encryptor
encrypt in interface Encryptorplaintext - the plaintext
EncryptionException - the encryption exception
public java.lang.String decrypt(java.lang.String ciphertext)
throws EncryptionException
Encryptor
decrypt in interface Encryptorciphertext - the ciphertext
EncryptionException - the encryption exception
public java.lang.String sign(java.lang.String data)
throws EncryptionException
Encryptor
sign in interface Encryptordata - the data
EncryptionException - the encryption exception
public boolean verifySignature(java.lang.String signature,
java.lang.String data)
Encryptor
verifySignature in interface Encryptorsignature - the signaturedata - the data
public java.lang.String seal(java.lang.String data,
long expiration)
throws IntegrityException
Encryptor
seal in interface Encryptordata - the dataexpiration - the absolute expiration date of the data, expressed as seconds since the epoch
IntegrityException
public java.lang.String unseal(java.lang.String seal)
throws EncryptionException
Encryptor
unseal in interface Encryptorseal - the sealed data
EncryptionExceptionpublic boolean verifySeal(java.lang.String seal)
Encryptor
verifySeal in interface Encryptorseal - the seal
public long getTimeStamp()
Encryptor
getTimeStamp in interface Encryptorpublic long getRelativeTimeStamp(long offset)
Encryptor
getRelativeTimeStamp in interface Encryptor
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||