ca.krasnay.crypt
Class EncryptionServiceImpl

java.lang.Object
  extended by ca.krasnay.crypt.EncryptionServiceImpl
All Implemented Interfaces:
EncryptionService

public class EncryptionServiceImpl
extends Object
implements EncryptionService


Constructor Summary
EncryptionServiceImpl(List<String> keys)
           
 
Method Summary
 byte[] decrypt(String cipherText)
          Decrypts the given cipher text to a byte array.
 String decryptString(String cipherText)
          Decrypts the given cipher text as a UTF-8 encoded string.
 String encrypt(byte[] plainText)
          Encrypts a byte array.
 String encryptString(String plainText)
          Encrypts the UTF-8 encoded bytes of the given string.
 String generateKey()
          Generates a new key for this service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncryptionServiceImpl

public EncryptionServiceImpl(List<String> keys)
Method Detail

decrypt

public byte[] decrypt(String cipherText)
Description copied from interface: EncryptionService
Decrypts the given cipher text to a byte array.

Specified by:
decrypt in interface EncryptionService

decryptString

public String decryptString(String cipherText)
Description copied from interface: EncryptionService
Decrypts the given cipher text as a UTF-8 encoded string.

Specified by:
decryptString in interface EncryptionService

encrypt

public String encrypt(byte[] plainText)
Description copied from interface: EncryptionService
Encrypts a byte array.

Specified by:
encrypt in interface EncryptionService

encryptString

public String encryptString(String plainText)
Description copied from interface: EncryptionService
Encrypts the UTF-8 encoded bytes of the given string.

Specified by:
encryptString in interface EncryptionService

generateKey

public String generateKey()
Description copied from interface: EncryptionService
Generates a new key for this service.

Specified by:
generateKey in interface EncryptionService


Copyright © 2015. All rights reserved.