Interface SealedSecret


public interface SealedSecret
An object which represents the information required to unseal a secret which has previously been sealed by a SecretServiceBackend implementation. Should only be constructed by SecretService implementations. Once constructed instances can be serialized to String representation using the toString(). This String can then be saved in persistent data source. Serialized Strings can be used to rebuild a SealedSecret object using the from(String). This object can then be unsealed by the same SecretServiceBackend which was used to originally seal it.
Since:
4.0.0
  • Method Details

    • from

      static SealedSecret from(String sealedSecret)
      Deserializes a String which was generated using the toString() method.
      Parameters:
      sealedSecret - a String representation of a SealedSecret object
      Returns:
      the original SealedSecret
    • isSealedSecret

      static boolean isSealedSecret(String string)
      Examines a String to check whether it has a SealedSecret prefix and would be expected to be a serialized SealedSecret.
      Parameters:
      string - a String value which may be a serialized SealedSecret
      Returns:
      whether the input parameter is expected to be a serialized SealedSecret
    • toString

      String toString()
      Serializes a SealedSecret to a String format so that it can be stored.
      Overrides:
      toString in class Object
      Returns:
      the SealedSecret serialized to a String
    • getIdentifier

      String getIdentifier()
      Returns the identifier of a secret originally sealed by the SecretServiceBackend.seal(String, String) method
      Returns:
      the identifier of the secret
    • getBackendId

      String getBackendId()
      Returns the identifier of the backend used to seal the secret originally.
      Returns:
      the identifier of the backend