Class TokenImpl

    • Constructor Detail

      • TokenImpl

        public TokenImpl()
      • TokenImpl

        public TokenImpl​(String sciToken,
                         URI jti)
      • TokenImpl

        public TokenImpl​(URI token)
    • Method Detail

      • getJti

        public URI getJti()
        If this is a JWT, then this returns the JTI. If not, it just returns the token.
        Specified by:
        getJti in interface NewToken
        Returns:
      • setJti

        public void setJti​(URI jti)
      • getJTIAsIdentifier

        public edu.uiuc.ncsa.security.core.Identifier getJTIAsIdentifier()
        Convenience method to return the JTI as an identifier.
        Specified by:
        getJTIAsIdentifier in interface NewToken
        Returns:
      • isOldVersion

        public boolean isOldVersion()
        Checks if the version is null, effectively meaning it was created before versions existed.
        Returns:
      • isJWT

        public boolean isJWT()
      • setJWT

        public void setJWT​(boolean JWT)
      • init

        protected void init​(URI uri)
      • getToken

        public String getToken()
        Description copied from interface: Token
        The token.
        Specified by:
        getToken in interface Token
        Returns:
      • getURIToken

        public URI getURIToken()
      • setToken

        public void setToken​(URI token)
      • setToken

        public void setToken​(String token)
      • createString

        protected StringBuilder createString()
        Does everything but final ]. Over-ride this and your toString() will work
        Returns:
      • isExpired

        public boolean isExpired()
        Specified by:
        isExpired in interface NewToken
      • setLifetime

        public void setLifetime​(long lifetime)
      • setVersion

        public void setVersion​(String version)
      • setIssuedAt

        public void setIssuedAt​(long issuedAt)
      • toJSON

        public net.sf.json.JSONObject toJSON()
        Specified by:
        toJSON in interface NewToken
      • newToJSON

        protected net.sf.json.JSONObject newToJSON()
      • oldToJSON

        protected net.sf.json.JSONObject oldToJSON()
      • hasPayload

        public boolean hasPayload()
      • getPayload

        public net.sf.json.JSONObject getPayload()
        If this token is a JWT, the is the actual payload.
        Returns:
      • setPayload

        public void setPayload​(net.sf.json.JSONObject payload)
      • fromJSON

        public void fromJSON​(net.sf.json.JSONObject json)
        Specified by:
        fromJSON in interface NewToken
      • getTokenType

        protected String getTokenType()
      • oldFromJSON

        public void oldFromJSON​(net.sf.json.JSONObject json)
      • newFromJSON

        protected void newFromJSON​(net.sf.json.JSONObject json)
      • main

        public static void main​(String[] args)
      • getExpiresAt

        public long getExpiresAt()
      • setExpiresAt

        public void setExpiresAt​(long expiresAt)