Class SADFactory


  • public class SADFactory
    extends Object
    A bean for building a SAD object and a signed JWT holding the SAD.
    Author:
    Martin Lindström (martin.lindstrom@litsec.se)
    • Field Detail

      • DEFAULT_VALIDITY_TIME

        public static final int DEFAULT_VALIDITY_TIME
        The default validity time for a SAD (five minutes).
        See Also:
        Constant Field Values
      • DEFAULT_JWT_ID_SIZE

        public static final int DEFAULT_JWT_ID_SIZE
        The default size for generated JWT identifiers (24)
        See Also:
        Constant Field Values
      • DEFAULT_JWT_SIGNING_ALGORITHM

        public static final String DEFAULT_JWT_SIGNING_ALGORITHM
        The name of the default JWT signature algorithm to be used (RS256).
    • Constructor Detail

      • SADFactory

        public SADFactory​(String idpEntityID,
                          X509Credential signingCredential)
        Constructor.
        Parameters:
        idpEntityID - the entityID of the issuing IdP
        signingCredential - the IdP signature credential
    • Method Detail

      • getBuilder

        public SADFactory.SADBuilder getBuilder()
        Returns a builder that allows building a SAD using a cascading builder pattern.
        Returns:
        a SAD builder
      • setValidityTime

        public void setValidityTime​(int seconds)
        Assigns the validity time for a SAD object (in seconds). The default is DEFAULT_VALIDITY_TIME.
        Parameters:
        seconds - validity time in seconds
      • setUserIdAttributeName

        public void setUserIdAttributeName​(String userIdAttributeName)
        Assigns the attribute name for the attribute holding the user ID. Defaults to DEFAULT_USER_ID_ATTRIBUTE_NAME.
        Parameters:
        userIdAttributeName - attribute name (URI)
      • setJwtIdSize

        public void setJwtIdSize​(int jwtIdSize)
        Assigns the size of generated JWT identifiers. The default is DEFAULT_JWT_ID_SIZE.
        Parameters:
        jwtIdSize - the size
      • setJwtSigningAlgorithm

        public void setJwtSigningAlgorithm​(String jwtSigningAlgorithm)
        Assigns the JWT signature algorithm. The default is DEFAULT_JWT_SIGNING_ALGORITHM.
        Parameters:
        jwtSigningAlgorithm - JWT algorithm name