Class SecurityToken

    • Field Detail

      • BOOTSTRAP_TOKEN_ID

        public static final String BOOTSTRAP_TOKEN_ID
        This tag holds an ID of a Bootstrap SecurityToken stored in the TokenStore
        See Also:
        Constant Field Values
    • Constructor Detail

      • SecurityToken

        public SecurityToken()
      • SecurityToken

        public SecurityToken​(String id)
    • Method Detail

      • getProperties

        public Map<String,​Object> getProperties()
        Returns:
        Returns the properties.
      • setProperties

        public void setProperties​(Map<String,​Object> properties)
        Parameters:
        properties - The properties to set.
      • getToken

        public Element getToken()
        Returns:
        Returns the token.
      • setToken

        public void setToken​(Element token)
        Parameters:
        token - The token to set.
      • getTransformedTokenIdentifier

        public String getTransformedTokenIdentifier()
        Get the identifier corresponding to a transformed version of this token
      • setTransformedTokenIdentifier

        public void setTransformedTokenIdentifier​(String transformedTokenIdentifier)
        Set the identifier corresponding to a transformed version of this token
      • setId

        public void setId​(String id)
        Set the id
      • getId

        public String getId()
        Returns:
        Returns the id.
      • getSecret

        public byte[] getSecret()
        Returns:
        Returns the secret.
      • setSecret

        public void setSecret​(byte[] secret)
        Parameters:
        secret - The secret to set.
      • getAttachedReference

        public Element getAttachedReference()
        Returns:
        Returns the attachedReference.
      • setAttachedReference

        public void setAttachedReference​(Element attachedReference)
        Parameters:
        attachedReference - The attachedReference to set.
      • getUnattachedReference

        public Element getUnattachedReference()
        Returns:
        Returns the unattachedReference.
      • setUnattachedReference

        public void setUnattachedReference​(Element unattachedReference)
        Parameters:
        unattachedReference - The unattachedReference to set.
      • getCreated

        public Instant getCreated()
        Returns:
        Returns the created.
      • getExpires

        public Instant getExpires()
        Returns:
        Returns the expires.
      • isExpired

        public boolean isExpired()
        Return whether this SecurityToken is expired or not
      • isAboutToExpire

        public boolean isAboutToExpire​(long secondsToExpiry)
        Return whether this SecurityToken is about to expire or not
      • setExpires

        public void setExpires​(Instant expires)
        Parameters:
        expires - The expires to set.
      • getIssuerAddress

        public String getIssuerAddress()
      • setIssuerAddress

        public void setIssuerAddress​(String issuerAddress)
      • setSHA1

        public void setSHA1​(String sha)
        Parameters:
        sha - SHA1 of the encrypted key
      • getSHA1

        public String getSHA1()
        Returns:
        SHA1 value of the encrypted key
      • getTokenType

        public String getTokenType()
      • setTokenType

        public void setTokenType​(String s)
      • setWsuId

        public void setWsuId​(String wsuId)
      • getWsuId

        public String getWsuId()
      • getIdFromSTR

        public static String getIdFromSTR​(Element str)
      • setX509Certificate

        public void setX509Certificate​(X509Certificate cert,
                                       org.apache.wss4j.common.crypto.Crypto cpt)
      • getCrypto

        public org.apache.wss4j.common.crypto.Crypto getCrypto()
      • setTokenHash

        public void setTokenHash​(int hash)
        Set a hash code associated with this token.
        Parameters:
        hash - a hash code associated with this token
      • getTokenHash

        public int getTokenHash()
        Get a hash code associated with this token.
        Returns:
        a hash code associated with this token.
      • setPrincipal

        public void setPrincipal​(Principal principal)
        Set the principal associated with this SecurityToken
        Parameters:
        principal - the principal associated with this SecurityToken
      • getPrincipal

        public Principal getPrincipal()
        Get the principal associated with this SecurityToken
        Returns:
        the principal associated with this SecurityToken
      • setSecurityContext

        public void setSecurityContext​(SecurityContext securityContext)
        Set the SecurityContext associated with this SecurityToken
        Parameters:
        securityContext - the SecurityContext associated with this SecurityToken
      • getSecurityContext

        public SecurityContext getSecurityContext()
        Get the SecurityContext associated with this SecurityToken
        Returns:
        the SecurityContext associated with this SecurityToken
      • getKey

        public Key getKey()
      • setKey

        public void setKey​(Key key)