Created
May 19, 2021 15:35
Revisions
-
dansomething created this gist
May 19, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ @Grapes([ @Grab(group='org.sonatype.plexus', module='plexus-sec-dispatcher', version='1.4'), @Grab(group='org.codehaus.plexus', module='plexus-utils', version='1.5.15'), @Grab(group='org.eclipse.sisu', module='org.eclipse.sisu.plexus', version='0.3.4'), ]) import org.sonatype.plexus.components.cipher.DefaultPlexusCipher import org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher def decryptSetting(String encrypted, String encryptedMaster) { return decrypt(encrypted, decryptMaster(encryptedMaster)) } def decrypt(String encrypted, String key) { DefaultPlexusCipher cipher = new DefaultPlexusCipher() return cipher.decryptDecorated(encrypted, key) } def decryptMaster(String encryptedMaster) { return decrypt(encryptedMaster, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION) }