Package org.mycore.crypt
Class MCRCryptCommands
java.lang.Object
org.mycore.frontend.cli.MCRAbstractCommands
org.mycore.crypt.MCRCryptCommands
- All Implemented Interfaces:
MCRExternalCommandInterface
This class provides a set of commands for the org.mycore.crypt management
which can be used by the command line interface.
- Author:
- Paul Borchert
-
Field Summary
Fields inherited from class org.mycore.frontend.cli.MCRAbstractCommands
command
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
decrypt {0} with cipher {1}static void
encrypt {0} with cipher {1}static void
generateKeyFile
(String cipherid) generate keyfile for cipher {0}static void
overwriteKeyFile
(String cipherid) generate and overwrite of keyfile of cipher {0}static void
list all cipher configurationMethods inherited from class org.mycore.frontend.cli.MCRAbstractCommands
addCommand, getDisplayName, getPossibleCommands, setDisplayName
-
Constructor Details
-
MCRCryptCommands
public MCRCryptCommands()
-
-
Method Details
-
showChipherConfig
@MCRCommand(syntax="show cipher configuration", help="The command list all chipher configured in mycore.properties", order=10) public static void showChipherConfig()list all cipher configuration -
generateKeyFile
@MCRCommand(syntax="generate keyfile for cipher {0}", help="The command generate the keyfile for the cipher configured in mycore.properties. Fails if key file exists.", order=20) public static void generateKeyFile(String cipherid) throws MCRCryptKeyFileNotFoundException, MCRCryptCipherConfigurationException generate keyfile for cipher {0}- Parameters:
cipherid
- String id of cipher configured in properties- Throws:
MCRCryptKeyFileNotFoundException
MCRCryptCipherConfigurationException
-
overwriteKeyFile
@MCRCommand(syntax="overwrite keyfile for cipher {0}", help="The command generate on overwrite the keyfile for the cipher configured in mycore.properties. Fails if key file exists.", order=20) public static void overwriteKeyFile(String cipherid) throws MCRCryptCipherConfigurationException, MCRCryptKeyFileNotFoundException generate and overwrite of keyfile of cipher {0}- Parameters:
cipherid
- String id of cipher configured in properties- Throws:
MCRCryptCipherConfigurationException
MCRCryptKeyFileNotFoundException
-
encrypt
@MCRCommand(syntax="encrypt {0} with cipher {1}", help="The command encrypt the value with cipher.", order=30) public static void encrypt(String value, String cipherid) throws MCRCryptKeyNoPermissionException, MCRCryptKeyFileNotFoundException, MCRCryptCipherConfigurationException encrypt {0} with cipher {1}- Parameters:
value
- The value to be encryptedcipherid
- String id of cipher configured in properties- Throws:
MCRCryptKeyNoPermissionException
MCRCryptKeyFileNotFoundException
MCRCryptCipherConfigurationException
-
decrypt
@MCRCommand(syntax="decrypt {0} with cipher {1}", help="The command encrypt the value with cipher.", order=40) public static void decrypt(String value, String cipherid) throws MCRCryptKeyNoPermissionException, MCRCryptKeyFileNotFoundException, MCRCryptCipherConfigurationException decrypt {0} with cipher {1}- Parameters:
value
- The value to be decryptedcipherid
- String id of cipher configured in properties- Throws:
MCRCryptKeyNoPermissionException
MCRCryptKeyFileNotFoundException
MCRCryptCipherConfigurationException
-