Class SAD


  • public class SAD
    extends Object
    Representation of the Signature Activation Data (SAD) as described in the "Signature Activation Protocol for Federated Signing" specification.
    Author:
    Martin Lindström (martin.lindstrom@litsec.se)
    • Constructor Detail

      • SAD

        public SAD()
    • Method Detail

      • fromJson

        public static SAD fromJson​(String json)
                            throws IOException
        Creates a SAD object from its JSON representation.
        Parameters:
        json - the JSON representation
        Returns:
        a SAD object
        Throws:
        IOException - for parsing errors
      • toJson

        public String toJson()
                      throws IOException
        Serializes the SAD object into its JSON representation.
        Returns:
        the JSON representation
        Throws:
        IOException - for processing errors
      • toJsonBytes

        public byte[] toJsonBytes()
                           throws IOException
        Serializes the SAD object into its JSON byte representation.
        Returns:
        the JSON bytes
        Throws:
        IOException - for processing errors
      • getSubject

        public String getSubject()
        Returns the attribute value of the signer's unique identifier attribute.
        Returns:
        the user ID
      • setSubject

        public void setSubject​(String subject)
        Assigns the attribute value of the signer's unique identifier attribute.
        Parameters:
        subject - the user ID
      • getAudience

        public String getAudience()
        Returns the entityID of the Signature Service which is the recipient of this SAD.
        Returns:
        the entityID of the recipient
      • setAudience

        public void setAudience​(String audience)
        Assigns the entityID of the Signature Service which is the recipient of this SAD.
        Parameters:
        audience - the entityID of the recipient
      • getIssuer

        public String getIssuer()
        Returns the entityID of the IdP that generated this SAD.
        Returns:
        the IdP entityID
      • setIssuer

        public void setIssuer​(String issuer)
        Assigns the entityID of the IdP that generated this SAD.
        Parameters:
        issuer - the IdP entityID
      • getExpiry

        public Integer getExpiry()
        Returns the time when this SAD is no longer valid (epoch time/seconds since 1970-01-01).
        Returns:
        number of seconds since 1970-01-01
      • getExpiryDateTime

        public Instant getExpiryDateTime()
        Returns the time when this SAD is no longer valid as a Instant instance.
        Returns:
        expiration time
      • setExpiry

        public void setExpiry​(Integer expiry)
        Assigns the time when this SAD is no longer valid (epoch time/seconds since 1970-01-01).
        Parameters:
        expiry - number of seconds since 1970-01-01
      • setExpiry

        public void setExpiry​(Instant expiry)
        Assigns the time when this SAD is no longer valid.
        Parameters:
        expiry - expiration time
      • getIssuedAt

        public Integer getIssuedAt()
        Returns the time when this SAD was issued (epoch time/seconds since 1970-01-01).
        Returns:
        number of seconds since 1970-01-01
      • getIssuedAtDateTime

        public Instant getIssuedAtDateTime()
        Returns the time when this SAD was issued as a Instant instance.
        Returns:
        timestamp
      • setIssuedAt

        public void setIssuedAt​(Integer issuedAt)
        Assigns the time when this SAD was issued (epoch time/seconds since 1970-01-01).
        Parameters:
        issuedAt - number of seconds since 1970-01-01
      • setIssuedAt

        public void setIssuedAt​(Instant issuedAt)
        Assigns the time when this SAD was issued.
        Parameters:
        issuedAt - issue time
      • getJwtId

        public String getJwtId()
        Returns the unique identifier of this JWT.
        Returns:
        JWT ID
      • setJwtId

        public void setJwtId​(String jwtId)
        Assigns the unique identifier of this JWT.
        Parameters:
        jwtId - JWT ID
      • getSeElnSadext

        public SAD.Extension getSeElnSadext()
        Returns the SAD extension claim.
        Returns:
        SAD extension claim
      • setSeElnSadext

        public void setSeElnSadext​(SAD.Extension seElnSadext)
        Assigns the SAD extension claim.
        Parameters:
        seElnSadext - SAD extension claim
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object