Package org.apache.shiro.crypto

Examples of org.apache.shiro.crypto.CipherService


     * @param serialized the serialized object byte array to be encrypted
     * @return an encrypted byte array returned by the configured {@link #getCipherService () cipher}.
     */
    protected byte[] encrypt(byte[] serialized) {
        byte[] value = serialized;
        CipherService cipherService = getCipherService();
        if (cipherService != null) {
            ByteSource byteSource = cipherService.encrypt(serialized, getEncryptionCipherKey());
            value = byteSource.getBytes();
        }
        return value;
    }
View Full Code Here


     * @param encrypted the encrypted byte array to decrypt
     * @return the decrypted byte array returned by the configured {@link #getCipherService () cipher}.
     */
    protected byte[] decrypt(byte[] encrypted) {
        byte[] serialized = encrypted;
        CipherService cipherService = getCipherService();
        if (cipherService != null) {
            ByteSource byteSource = cipherService.decrypt(encrypted, getDecryptionCipherKey());
            serialized = byteSource.getBytes();
        }
        return serialized;
    }
View Full Code Here

     * @param serialized the serialized object byte array to be encrypted
     * @return an encrypted byte array returned by the configured {@link #getCipherService () cipher}.
     */
    protected byte[] encrypt(byte[] serialized) {
        byte[] value = serialized;
        CipherService cipherService = getCipherService();
        if (cipherService != null) {
            ByteSource byteSource = cipherService.encrypt(serialized, getEncryptionCipherKey());
            value = byteSource.getBytes();
        }
        return value;
    }
View Full Code Here

     * @param encrypted the encrypted byte array to decrypt
     * @return the decrypted byte array returned by the configured {@link #getCipherService () cipher}.
     */
    protected byte[] decrypt(byte[] encrypted) {
        byte[] serialized = encrypted;
        CipherService cipherService = getCipherService();
        if (cipherService != null) {
            ByteSource byteSource = cipherService.decrypt(encrypted, getDecryptionCipherKey());
            serialized = byteSource.getBytes();
        }
        return serialized;
    }
View Full Code Here

    return fmt.format(date);
  }

  private static byte[] encrypt(byte[] serialized) {
    byte[] value = serialized;
    CipherService cipherService = new AesCipherService();
    if (cipherService != null) {
      ByteSource byteSource = cipherService.encrypt(serialized, Base64.decode("kPH+bIxk5D2deZiIxcaaaA=="));
      value = byteSource.getBytes();
    }
    return value;
  }
View Full Code Here

TOP

Related Classes of org.apache.shiro.crypto.CipherService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.