Class AbstractStorageSecretEngine

  • All Implemented Interfaces:
    SecretEngine

    public abstract class AbstractStorageSecretEngine
    extends java.lang.Object
    implements SecretEngine
    • Field Detail

      • STORAGE_FILE_URI

        protected static final java.lang.String STORAGE_FILE_URI
        See Also:
        Constant Field Values
      • STORAGE_PROP_KEY

        protected static final java.lang.String STORAGE_PROP_KEY
        See Also:
        Constant Field Values
      • cache

        protected java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.Object>> cache
    • Constructor Detail

      • AbstractStorageSecretEngine

        public AbstractStorageSecretEngine()
    • Method Detail

      • validate

        public void validate​(EncryptedSecret encryptedSecret)
                      throws InvalidSecretFormatException
        Description copied from interface: SecretEngine
        In order for a secretEngine to decrypt an EncryptedSecret, it may require extra information (e.g. decryptionKey, location, encryptionMethod, etc). This method takes an EncryptedSecret and validates it contains the required information the service needs for decryption. Parameter names should not contain ':'
        Specified by:
        validate in interface SecretEngine
        Parameters:
        encryptedSecret - The encrypted secret
        Throws:
        InvalidSecretFormatException - If the encrypted secret is malformed
      • encrypt

        public EncryptedSecret encrypt​(java.lang.String secretToEncrypt)
                                throws java.lang.UnsupportedOperationException
        Specified by:
        encrypt in interface SecretEngine
        Throws:
        java.lang.UnsupportedOperationException
      • downloadRemoteFile

        protected abstract java.io.InputStream downloadRemoteFile​(EncryptedSecret encryptedSecret)
                                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • readAll

        protected byte[] readAll​(java.io.InputStream inputStream)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • parseAsYaml

        protected void parseAsYaml​(java.lang.String fileURI,
                                   java.io.InputStream inputStream)