/securekey-maven-plugin

A simple maven plugin to generate an AES encryption key and convert it to BASE64 encoded string during maven build time.

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

securekey-maven-plugin

This plugin is used to generate a AES key using javax.crypto.SecretKey which is then Base64 encoded during build time and store it in the file system. The "secret" to generate the key is passed as a parameter in the plugin configuration

JDk8 Build Status

This plugin is available on maven central

Apache Maven

<plugins>
    .
    .
    .
    <plugin>
        <groupId>com.github.agogs</groupId>
        <artifactId>securekey-maven-plugin</artifactId>
        <executions>
            <execution>
                <configuration>
                    <keySize>256</keySize>                      <!-- optional, default is 128 bits-->
                    <algorithm>AES</algorithm>
                    <secret>secret</secret>                     <!-- optional, default = random string -->
                    <fileName>key.properties</fileName>         <!-- optional, default = securekey.properties -->
                    <filePath>/path/to/file</filePath>          <!-- optional, default is project root-->
                    <propertyName>property.name</propertyName>  <!-- optional, default = secure.key.encoded -->
                </configuration>
            </execution>
        </executions>
    </plugin>
    .
    .
    .
</plugins>