Custom encryption



アトラシアン コミュニティをご利用ください。


In addition to the basic and advanced encryption methods that you can use in Bitbucket Data Center and Server, you can also choose to create your own Cipher. This might be especially useful if:

  • you're required to use a specific vault to store the password

  • you want to use encryption algorithms beyond those we ship with Bitbucket

Step 1. Create a Maven project and get API dependencies 

  1. Get password-cipher-api and password-cipher-base dependencies.

    1. <Bitbucket_installation_directory>/atlassian-bitbucket/WEB-INF/lib に移動します。

    2. 以下の jar ファイルをコピーします。

    • password-cipher-api-<version>.jar: this file contains the API

    • (optional) password-cipher-base-<version>.jar: this file contains some sample implementations 

  2. Maven プロジェクトを作成します。

  3. Go to resources and create a new folder, named libs.

  4. jar ファイルを libs フォルダにコピーします。

  5. Next, use the following pom

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns=""

Step 2. Implement the Cipher interface

The Cipher interface contains two methods that you need to implement according to your requirements; encrypt and decrypt. decrypt is called during Bitbucket startup, which means that long-running tasks can affect the startup time. encrypt is not called by Bitbucket, as it's only used in the encryption tool.

You can use Base64Cipher and AlgorithmCipher as examples. 

Step 3. Test your implementation

The encryption tool described in Basic encryption and Advanced encryption, uses the same code as Bitbucket to decrypt the password. You can use it to test your implementation.

Assuming that the CLI and your jar is in the same folder:

java -cp "./*" -c

Step 4. Make your library available

Bitbucket must be able to access your library. Your class will be instantiated using reflection. Put the library in the following directory:

最終更新日: 2021 年 10 月 28 日


Powered by Confluence and Scroll Viewport.