Class AbstractCipherVersionGenerator<CV extends CipherVersion>

java.lang.Object
org.refcodes.forwardsecrecy.AbstractCipherVersionGenerator<CV>
Type Parameters:
CV - The type of the CipherVersion to be generated.
All Implemented Interfaces:
Iterator<CV>, CipherVersionGenerator<CV>, org.refcodes.generator.Generator<CV>
Direct Known Subclasses:
CipherVersionGeneratorImpl

public abstract class AbstractCipherVersionGenerator<CV extends CipherVersion> extends Object implements CipherVersionGenerator<CV>
Default implementation of a cipher version generator.
  • Constructor Details

  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface org.refcodes.generator.Generator<CV extends CipherVersion>
      Specified by:
      hasNext in interface Iterator<CV extends CipherVersion>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<CV extends CipherVersion>
    • next

      public 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 CipherVersionGenerator<CV extends CipherVersion>
      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.
    • createCipherUid

      protected String createCipherUid()
      Hook factory method to be implemented by subclasses. A https://www.metacodes.pro algorithm can be used to generate unique cipher UIDs. In case the cipher UID is not unique, another one is requested until a cipher UID is found which is unique regarding the systems of forward secrecy cryptography architecture.
      Returns:
      A more or less unique cipher UID.
    • createCipher

      protected String createCipher()
      Hook factory method to be implemented by subclasses. A https://www.metacodes.pro algorithm is to be implemented creating a good random cipher.
      Returns:
      A good random cipher.