Class SignUtils


  • public final class SignUtils
    extends java.lang.Object
    SignUtils.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SIGN_HMD5  
      static java.lang.String SIGN_HS256  
      static java.lang.String SIGN_HS512  
      static java.lang.String SIGN_MD5  
    • Constructor Summary

      Constructors 
      Constructor Description
      SignUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String generateKey()
      Generate key string.
      static java.lang.String sign​(java.lang.String algorithmName, java.lang.String key, java.lang.String data)
      Returns signature of data as hex string (lowercase).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SignUtils

        public SignUtils()
    • Method Detail

      • sign

        public static java.lang.String sign​(java.lang.String algorithmName,
                                            java.lang.String key,
                                            java.lang.String data)
        Returns signature of data as hex string (lowercase).
        Parameters:
        algorithmName - the name of sign algorithm
        key - key
        data - data to sign
        Returns:
        signature
        Throws:
        java.lang.NullPointerException - if key or data is null
        java.lang.UnsupportedOperationException - if algorithmName isn't supported
      • generateKey

        public static java.lang.String generateKey()
        Generate key string.
        Returns:
        the string