Interface CipherVersionGenerator<CV extends CipherVersion>

Type Parameters:
CV - The type of the CipherVersion to be generated.
All Superinterfaces:
org.refcodes.generator.Generator<CV>, Iterator<CV>
All Known Subinterfaces:
EncryptionService
All Known Implementing Classes:
AbstractCipherVersionGenerator, AbstractEncryptionService, CipherVersionGeneratorImpl, LoopbackEncryptionService, PublicKeyEncryptionService

public interface CipherVersionGenerator<CV extends CipherVersion> extends org.refcodes.generator.Generator<CV>
Depending on the security demands and performance issues; the Generator generating CipherVersion instances can be replaced with a custom CipherVersionGenerator using its own approach generating ciphers and cipher UIDs (CipherVersion instances).

In case you provide your custom CipherVersionGenerator implementation, make sure the CipherVersion (sub-)type you return fits with the CipherVersion (sub-)type of your custom CipherVersionFactory. A good approach is to make your custom CipherVersionGenerator make use your custom CipherVersionFactory.

See the default implementations CipherVersionGeneratorImpl, the AbstractCipherVersionGenerator and the CipherVersionFactoryImpl.

  • Method Summary

    Modifier and Type
    Method
    Description
    Generator method to be implemented by subclasses.

    Methods inherited from interface org.refcodes.generator.Generator

    hasNext

    Methods inherited from interface java.util.Iterator

    forEachRemaining, remove
  • Method Details

    • next

      CV next()
      Generator method to be implemented by subclasses. Required to create implementation dependent cipher version objects. Retrieves the next valid cipher which may be used for encrypting data.
      Specified by:
      next in interface org.refcodes.generator.Generator<CV extends CipherVersion>
      Specified by:
      next in interface Iterator<CV extends CipherVersion>
      Returns:
      The next valid CipherVersion for encryption.