Class CryptoKeyUtils

java.lang.Object
com.bld.crypto.bean.CryptoKeyUtils
Direct Known Subclasses:
CryptoAesUtils, CryptoJksUtils, CryptoPublicKeyUtils

public abstract class CryptoKeyUtils extends Object
The Class CryptoKeyUtils.
  • Field Details

    • _252F

      protected static final String _252F
      The Constant _252F.
      See Also:
    • _2F

      protected static final String _2F
      The Constant _2F.
      See Also:
    • objMapper

      @Autowired protected com.fasterxml.jackson.databind.ObjectMapper objMapper
      The obj mapper.
  • Constructor Details

    • CryptoKeyUtils

      public CryptoKeyUtils()
  • Method Details

    • instanceType

      protected abstract InstanceType instanceType()
      Instance type.
      Returns:
      the instance type
    • getCipher

      protected Cipher getCipher(int mode, Key key) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException
      Gets the cipher.
      Parameters:
      mode - the mode
      key - the key
      Returns:
      the cipher
      Throws:
      NoSuchAlgorithmException - the no such algorithm exception
      NoSuchPaddingException - the no such padding exception
      InvalidKeyException - the invalid key exception
    • encryptValue

      public String encryptValue(String value, Key key)
      Encrypt value.
      Parameters:
      value - the value
      key - the key
      Returns:
      the string
    • decryptValue

      public String decryptValue(String value, Key key)
      Decrypt value.
      Parameters:
      value - the value
      key - the key
      Returns:
      the string
    • encryptValue

      protected abstract String encryptValue(String value, String key)
      Encrypt value.
      Parameters:
      value - the value
      key - the key
      Returns:
      the string
    • decryptValue

      protected abstract String decryptValue(String value, String key)
      Decrypt value.
      Parameters:
      value - the value
      key - the key
      Returns:
      the string
    • encryptUri

      protected String encryptUri(String value, String key)
      Encrypt uri.
      Parameters:
      value - the value
      key - the key
      Returns:
      the string
    • encodeValue

      protected String encodeValue(String valueEncrypted)
      Encode value.
      Parameters:
      valueEncrypted - the value encrypted
      Returns:
      the string
    • decryptUri

      protected String decryptUri(String value, String key)
      Decrypt uri.
      Parameters:
      value - the value
      key - the key
      Returns:
      the string