Cumulus4j API
(1.1.0)

org.cumulus4j.store.crypto.keymanager
Class CryptoCacheCipherEntry

java.lang.Object
  extended by org.cumulus4j.store.crypto.keymanager.CryptoCacheCipherEntry

public class CryptoCacheCipherEntry
extends Object

CryptoCache-entry wrapping a Cipher used for symmetric data-en-/decryption.

Author:
Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de

Constructor Summary
protected CryptoCacheCipherEntry(CryptoCacheKeyEntry keyEntry, CryptoCacheCipherEntry original)
          Create a new instance copying an old one.
protected CryptoCacheCipherEntry(CryptoCacheKeyEntry keyEntry, String cipherTransformation, Cipher cipher)
          Create a new instance.
 
Method Summary
 Cipher getCipher()
          Get the cipher.
 String getCipherTransformation()
          Get the transformation (as passed to CryptoRegistry.createCipher(String)).
 CryptoCacheKeyEntry getKeyEntry()
          Get the corresponding key-entry.
 Date getLastUsageTimestamp()
          Get the timestamp when the cipher was used the last time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CryptoCacheCipherEntry

protected CryptoCacheCipherEntry(CryptoCacheKeyEntry keyEntry,
                                 String cipherTransformation,
                                 Cipher cipher)
Create a new instance.

Parameters:
keyEntry - the corresponding key-entry. Must not be null.
cipherTransformation - the transformation (as passed to CryptoRegistry.createCipher(String)). Must not be null.
cipher - the cipher. Must not be null.

CryptoCacheCipherEntry

protected CryptoCacheCipherEntry(CryptoCacheKeyEntry keyEntry,
                                 CryptoCacheCipherEntry original)
Create a new instance copying an old one. Used to refresh an existing entry (as it assigns a new lastUsageTimestamp) while keeping this class immutable.

Parameters:
keyEntry - the key-entry.
original - the original from which to copy.
Method Detail

getKeyEntry

public CryptoCacheKeyEntry getKeyEntry()
Get the corresponding key-entry.

Returns:
the corresponding key-entry; never null.

getCipherTransformation

public String getCipherTransformation()
Get the transformation (as passed to CryptoRegistry.createCipher(String)).

Returns:
the transformation (as passed to CryptoRegistry.createCipher(String)); never null.

getCipher

public Cipher getCipher()
Get the cipher.

Returns:
the cipher; never null.

getLastUsageTimestamp

public Date getLastUsageTimestamp()
Get the timestamp when the cipher was used the last time.

Returns:
the timestamp when the cipher was used the last time.

Cumulus4j API
(1.1.0)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.