Class CryptomanagerUtils


  • @RefreshScope
    @Component
    public class CryptomanagerUtils
    extends Object
    Util class for this project.
    Since:
    1.0.0
    Author:
    Urvil Joshi, Manoj SP
    • Constructor Detail

      • CryptomanagerUtils

        public CryptomanagerUtils()
    • Method Detail

      • nullOrTrim

        public static String nullOrTrim​(String parameter)
        Change Parameter form to trim if not null.
        Parameters:
        parameter - parameter
        Returns:
        null if null;else trimmed string
      • isValidSalt

        public boolean isValidSalt​(String salt)
        Function to check is salt is valid.
        Parameters:
        salt - salt
        Returns:
        true if salt is valid, else false
      • parseToLocalDateTime

        public LocalDateTime parseToLocalDateTime​(String dateTime)
        Parse a date string of pattern UTC_DATETIME_PATTERN into LocalDateTime.
        Parameters:
        dateTimeof - type String of pattern UTC_DATETIME_PATTERN
        Returns:
        a LocalDateTime of given pattern
      • hexDecode

        public byte[] hexDecode​(String hexData)
        hex decode string to byte array
        Parameters:
        hexData - type String
        Returns:
        a byte of given data
      • getCertificateThumbprint

        public byte[] getCertificateThumbprint​(Certificate cert)
      • concatCertThumbprint

        public byte[] concatCertThumbprint​(byte[] certThumbprint,
                                           byte[] encryptedKey)