Interface SecretEncryptionService

All Known Implementing Classes:
MockSecretEncryptionService, RemoteAgentSecretEncryptionService, SecretEncryptionServiceImpl

public interface SecretEncryptionService
Implementations of this class encrypt secrets (passphrases/passwords/keys/etc.) within Bamboo. The format of the encoded secret includes Base64-encoded ciphertext with metadata detailing the algorithms used.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    decrypt(@NotNull String encryptedSecret)
    Decrypts the supplied secret.
    @NotNull String
    decryptIfDecryptable(@NotNull String encryptedSecret)
    Decrypts secret if possible or returns original string if not.
    @NotNull String
    encrypt(@NotNull String secretToEncrypt)
    Encrypts the supplied string.
    boolean
    isDecryptable(@NotNull String encryptedSecret)
     
    boolean
    isEncrypted(@NotNull String string)
    Whether the supplied string has been encrypted by this service.
  • Method Details

    • isEncrypted

      boolean isEncrypted(@NotNull @NotNull String string)
      Whether the supplied string has been encrypted by this service.
    • isDecryptable

      boolean isDecryptable(@NotNull @NotNull String encryptedSecret)
      Returns:
      true if Bamboo can decrypt given value.
    • decrypt

      @NotNull @NotNull String decrypt(@NotNull @NotNull String encryptedSecret)
      Decrypts the supplied secret.
      Throws:
      RuntimeException - if secret cannot be decrypted.
    • decryptIfDecryptable

      @NotNull @NotNull String decryptIfDecryptable(@NotNull @NotNull String encryptedSecret)
      Decrypts secret if possible or returns original string if not.
      Since:
      9.1
    • encrypt

      @NotNull @NotNull String encrypt(@NotNull @NotNull String secretToEncrypt)
      Encrypts the supplied string.