psdi.security

Class ApplicationSessionKeys

  • java.lang.Object
    • psdi.security.ApplicationSessionKeys
  • All Implemented Interfaces:
    java.io.Serializable


    public class ApplicationSessionKeys
    extends java.lang.Object
    implements java.io.Serializable
    A class used to represent a set of session keys that are generated, maintained and used when MAXIMO application is enabled to use Application Server security. When MAXIMO application is enabled to use Application Server security, only the client that obtains one of the signed session keys is granted access to MAXIMO business objects. The client program can obtain the signed session key data from the accesstoken provider bean (ejb bean), which will be enabled to work with Application Server security, and there by the ejb container ensures that the caller is authenticated before granting access to the bean.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static ApplicationSessionKeys getDefaultApplicationSessionKeys(java.lang.Object key)
      Returns the application session keys based on a valid key.
      java.security.PrivateKey getPrivateKey()
      Returns the private key.
      java.security.PublicKey getPublicKey()
      Returns the public key.
      boolean isInitialized()
      Returns whether the keys are initialized or not.
      static boolean isValidSessionData(byte[] signedSessionData, java.lang.String data)
      Verifies the session data passed with the default session data generated by this application.
      void setInitialized(boolean b)
      Sets whether the keys are initialized or not.
      void setPrivateKey(java.security.PrivateKey key)
      Sets private key
      void setPublicKey(java.security.PublicKey key)
      Sets public key
      byte[] signData(java.lang.String data)
      Signs the passed data using the private key and returns the signed data.
      boolean verifySignedData(byte[] signedData, java.lang.String data)
      Verifies the signed data using the public key.
      • Methods inherited from class java.lang.Object

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

      • getPrivateKey

        public java.security.PrivateKey getPrivateKey()
        Returns the private key.
        Returns:
        the private key.
      • setPrivateKey

        public void setPrivateKey(java.security.PrivateKey key)
        Sets private key
        Parameters:
        key - private key
      • getPublicKey

        public java.security.PublicKey getPublicKey()
        Returns the public key.
        Returns:
        the public key.
      • setPublicKey

        public void setPublicKey(java.security.PublicKey key)
        Sets public key
        Parameters:
        key - public key
      • isInitialized

        public boolean isInitialized()
        Returns whether the keys are initialized or not.
        Returns:
        true, to indicate that keys are initialized, otherwise false.
      • setInitialized

        public void setInitialized(boolean b)
        Sets whether the keys are initialized or not.
        Parameters:
        b - true, to indicate that keys are initialized, otherwise false.
      • getDefaultApplicationSessionKeys

        public static final ApplicationSessionKeys getDefaultApplicationSessionKeys(java.lang.Object key)
                                                                             throws java.lang.Exception
        Returns the application session keys based on a valid key.
        Parameters:
        key - a valid key.
        Returns:
        ApplicationSessionKeys
        Throws:
        java.lang.Exception - if fails to generate session keys or the key passed is invalid.
      • isValidSessionData

        public static boolean isValidSessionData(byte[] signedSessionData,
                                                 java.lang.String data)
        Verifies the session data passed with the default session data generated by this application.
        Parameters:
        signedSessionData - signed session data to be verified
        data - data to be verified
        Returns:
        true, if the session data is valid, otherwise false.
      • signData

        public byte[] signData(java.lang.String data)
                        throws java.lang.Exception
        Signs the passed data using the private key and returns the signed data.
        Parameters:
        data - data to be signed
        Returns:
        signed data
        Throws:
        java.lang.Exception - if fails to sign the data.
      • verifySignedData

        public boolean verifySignedData(byte[] signedData,
                                        java.lang.String data)
                                 throws java.lang.Exception
        Verifies the signed data using the public key.
        Parameters:
        signedData - signed data to be verified
        data - data to be verified against
        Returns:
        true, if the verification is successful, otherwise false.
        Throws:
        java.lang.Exception - if fails to verify.