Class MostRecentProvider

  • All Implemented Interfaces:
    EncryptionMaterialsProvider

    @Deprecated
    public class MostRecentProvider
    extends Object
    implements EncryptionMaterialsProvider
    Deprecated.
    This provider uses a TTL value to determine when to ping the keystore to get the current materials version, instead of using the TTL value to determine when to expire cached materials. This is unintuitive behavior for users of this provider who may wish to use a TTL to force the keystore to re-obtain materials. Use the CachingMostRecentProvider, which uses a user defined TTL value to also expire the cached materials themselves, forcing the keystore to regularly re-obtain materials.
    This meta-Provider encrypts data with the most recent version of keying materials from a ProviderStore and decrypts using whichever version is appropriate. It also caches the results from the ProviderStore to avoid excessive load on the backing systems. The cache is not currently configurable.
    • Field Detail

      • defaultMaterialName

        protected final String defaultMaterialName
        Deprecated.
    • Constructor Detail

      • MostRecentProvider

        public MostRecentProvider​(ProviderStore keystore,
                                  String materialName,
                                  long ttlInMillis)
        Deprecated.
        Creates a new MostRecentProvider.
        Parameters:
        ttlInMillis - The length of time in milliseconds to cache the most recent provider
    • Method Detail

      • getEncryptionMaterials

        public EncryptionMaterials getEncryptionMaterials​(EncryptionContext context)
        Deprecated.
        Description copied from interface: EncryptionMaterialsProvider
        Returns EncryptionMaterials which the caller can use for encryption. Each implementation of EncryptionMaterialsProvider can choose its own strategy for loading encryption material. For example, an implementation might load encryption material from an existing key management system, or load new encryption material when keys are rotated.
        Specified by:
        getEncryptionMaterials in interface EncryptionMaterialsProvider
        Parameters:
        context - Information to assist in selecting a the proper return value. The implementation is free to determine the minimum necessary for successful processing.
        Returns:
        EncryptionMaterials which the caller can use to encrypt or decrypt data.
      • getDecryptionMaterials

        public DecryptionMaterials getDecryptionMaterials​(EncryptionContext context)
        Deprecated.
        Description copied from interface: EncryptionMaterialsProvider
        Retrieves encryption materials matching the specified description from some source.
        Specified by:
        getDecryptionMaterials in interface EncryptionMaterialsProvider
        Parameters:
        context - Information to assist in selecting a the proper return value. The implementation is free to determine the minimum necessary for successful processing.
        Returns:
        The encryption materials that match the description, or null if no matching encryption materials found.
      • refresh

        public void refresh()
        Deprecated.
        Completely empties the cache of both the current and old versions.
        Specified by:
        refresh in interface EncryptionMaterialsProvider
      • getMaterialName

        public String getMaterialName()
        Deprecated.
      • getTtlInMills

        public long getTtlInMills()
        Deprecated.
      • getCurrentVersion

        public long getCurrentVersion()
        Deprecated.
        The current version of the materials being used for encryption. Returns -1 if we do not currently have a current version.
      • getLastUpdated

        public long getLastUpdated()
        Deprecated.
        The last time the current version was updated. Returns 0 if we do not currently have a current version.