Class MCRCipherManager

java.lang.Object
org.mycore.crypt.MCRCipherManager

public class MCRCipherManager extends Object
Create Instances of MCRCipher as configured in mycore.properties. The cipher is defined by the java class. The secret key is saved in an keyfile. MCR.Crypt.Cipher.abstract.Class=org.mycore.crypt.MCRAESCipher MCR.Crypt.Cipher.abstract.KeyFile=example_1.secret
  • Constructor Details

    • MCRCipherManager

      public MCRCipherManager()
  • Method Details

    • getCipher

      public static MCRCipher getCipher(String id) throws MCRCryptKeyFileNotFoundException
      Create a single instance of a MCRCipher and initialize it. If the cipher can't initialized an exception will thrown. Common issue is an missing key. In this case the methods throws a MCRCryptKeyFileNotFoundException.
      Parameters:
      id - ID of cipher as configured
      Returns:
      instance of cipher
      Throws:
      MCRCryptKeyFileNotFoundException
    • getUninitialisedCipher

      public static MCRCipher getUninitialisedCipher(String id)
      Create a single instance of a MCRCipher without initialising it. The resulting instance can used to generate an new key.
      Parameters:
      id - ID of cipher as configured
      Returns:
      instance of cipher