Package com.atlassian.secrets.api
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 Summary
Modifier and TypeMethodDescriptionstatic SealedSecretDeserializes aStringwhich was generated using thetoString()method.Returns the identifier of the backend used to seal the secret originally.Returns the identifier of a secret originally sealed by theSecretServiceBackend.seal(String, String)methodstatic booleanisSealedSecret(String string) Examines a String to check whether it has aSealedSecretprefix and would be expected to be a serializedSealedSecret.toString()Serializes aSealedSecretto aStringformat so that it can be stored.
-
Method Details
-
from
Deserializes aStringwhich was generated using thetoString()method.- Parameters:
sealedSecret- aStringrepresentation of aSealedSecretobject- Returns:
- the original
SealedSecret
-
isSealedSecret
Examines a String to check whether it has aSealedSecretprefix and would be expected to be a serializedSealedSecret.- Parameters:
string- aStringvalue which may be a serializedSealedSecret- Returns:
- whether the input parameter is expected to be a serialized SealedSecret
-
toString
String toString()Serializes aSealedSecretto aStringformat so that it can be stored.- Overrides:
toStringin classObject- Returns:
- the
SealedSecretserialized to aString
-
getIdentifier
String getIdentifier()Returns the identifier of a secret originally sealed by theSecretServiceBackend.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
-