Class AesEncryptionStrategy

java.lang.Object
com.structurizr.encryption.EncryptionStrategy
com.structurizr.encryption.AesEncryptionStrategy

public final class AesEncryptionStrategy
extends EncryptionStrategy
This is implementation of an AES encryption strategy, allowing you to specify the key size, iteration count and passphrase.
  • Constructor Summary

    Constructors 
    Constructor Description
    AesEncryptionStrategy​(int keySize, int iterationCount, java.lang.String passphrase)  
    AesEncryptionStrategy​(int keySize, int iterationCount, java.lang.String salt, java.lang.String iv, java.lang.String passphrase)  
    AesEncryptionStrategy​(java.lang.String passphrase)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String decrypt​(java.lang.String ciphertext)  
    java.lang.String encrypt​(java.lang.String plaintext)  
    int getIterationCount()  
    java.lang.String getIv()  
    int getKeySize()  
    java.lang.String getSalt()  

    Methods inherited from class com.structurizr.encryption.EncryptionStrategy

    getLocation, getPassphrase, setLocation, setPassphrase

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AesEncryptionStrategy

      public AesEncryptionStrategy​(java.lang.String passphrase)
    • AesEncryptionStrategy

      public AesEncryptionStrategy​(int keySize, int iterationCount, java.lang.String passphrase)
    • AesEncryptionStrategy

      public AesEncryptionStrategy​(int keySize, int iterationCount, java.lang.String salt, java.lang.String iv, java.lang.String passphrase)
  • Method Details

    • encrypt

      public java.lang.String encrypt​(java.lang.String plaintext) throws java.lang.Exception
      Specified by:
      encrypt in class EncryptionStrategy
      Throws:
      java.lang.Exception
    • decrypt

      public java.lang.String decrypt​(java.lang.String ciphertext) throws java.lang.Exception
      Specified by:
      decrypt in class EncryptionStrategy
      Throws:
      java.lang.Exception
    • getKeySize

      public int getKeySize()
    • getIterationCount

      public int getIterationCount()
    • getSalt

      public java.lang.String getSalt()
    • getIv

      public java.lang.String getIv()