Class AuthTokenUtils


  • public class AuthTokenUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      AuthTokenUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.crypto.SecretKey createSecretKey​(io.jsonwebtoken.SignatureAlgorithm signatureAlgorithm)  
      static java.lang.String createToken​(java.security.Key signingKey, java.lang.String subject, java.util.Optional<java.util.Date> expiryTime)  
      static java.security.PrivateKey decodePrivateKey​(byte[] key, io.jsonwebtoken.SignatureAlgorithm algType)  
      static java.security.PublicKey decodePublicKey​(byte[] key, io.jsonwebtoken.SignatureAlgorithm algType)  
      static javax.crypto.SecretKey decodeSecretKey​(byte[] secretKey)  
      static java.lang.String encodeKeyBase64​(java.security.Key key)  
      static byte[] readKeyFromUrl​(java.lang.String keyConfUrl)  
      • Methods inherited from class java.lang.Object

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

      • AuthTokenUtils

        public AuthTokenUtils()
    • Method Detail

      • createSecretKey

        public static javax.crypto.SecretKey createSecretKey​(io.jsonwebtoken.SignatureAlgorithm signatureAlgorithm)
      • decodeSecretKey

        public static javax.crypto.SecretKey decodeSecretKey​(byte[] secretKey)
      • decodePrivateKey

        public static java.security.PrivateKey decodePrivateKey​(byte[] key,
                                                                io.jsonwebtoken.SignatureAlgorithm algType)
                                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • decodePublicKey

        public static java.security.PublicKey decodePublicKey​(byte[] key,
                                                              io.jsonwebtoken.SignatureAlgorithm algType)
                                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • encodeKeyBase64

        public static java.lang.String encodeKeyBase64​(java.security.Key key)
      • createToken

        public static java.lang.String createToken​(java.security.Key signingKey,
                                                   java.lang.String subject,
                                                   java.util.Optional<java.util.Date> expiryTime)
      • readKeyFromUrl

        public static byte[] readKeyFromUrl​(java.lang.String keyConfUrl)
                                     throws java.io.IOException
        Throws:
        java.io.IOException