Class SASLParametersProfile

java.lang.Object
com.isode.dsapi.SASLParameters
com.isode.dsapi.profile.SASLParametersProfile

public class SASLParametersProfile extends SASLParameters

When stored in a BindProfile file, callback parameters will only be written in encrypted form. If no passphrase is associated with the file, then no callback parameters will be written at all.

If a BindProfile file is loaded without a passphrase having been specified (e.g. a "read-only" BindProfileList), then any callback parameters that happen to be stored in the file will not be loaded from it (since it will not be possible to decrypt them).

Since:
16.1 (extracted from SASLPArameters 14.6 internal)
Author:
mst
  • Field Details

    • xmlTag

      public static final String xmlTag
      The tag that is used to bracket SASLParameters when they're stored as XML.
      See Also:
  • Constructor Details

    • SASLParametersProfile

      public SASLParametersProfile(String saslMechs) throws BadValueException
      Create a new SASLParametersProfile object specifying nothing but one or more mechanism names.
      Parameters:
      saslMechs - must not be null. If more than one mechanism is specified, the names should be space separated, e.g. "GSSAPI NTLM"
      Throws:
      BadValueException - when mechanisms string doesn't contain at least one correct SASL mechanism name or there are unknown names.
    • SASLParametersProfile

      public SASLParametersProfile(SASLParameters other)
      Construct a new object by copying another (so that subsequent changes to the original object won't affect this one).
      Parameters:
      other - another object (not null)
    • SASLParametersProfile

      public SASLParametersProfile(SASLParametersProfile other)
      Construct a new object by copying another (so that subsequent changes to the original object won't affect this one).
      Parameters:
      other - another object (not null)
    • SASLParametersProfile

      public SASLParametersProfile(com.isode.util.XMLInput xmlInput) throws SAXException
      Create a SASLParameters object from an XML input stream. It is assumed that xmlInput is positioned at the start of the data for the SASLParameters.

      This method must work in a consistent way to writeXML(XMLOutput)

      Parameters:
      xmlInput - an XMLInput object that is positioned at the start of data for a SASLParameters.
      Throws:
      SAXException - if an error occurs when attempting to parse the SASLParameters from the XML
      See Also:
  • Method Details

    • writeXML

      public void writeXML(com.isode.util.XMLOutput xmlOutput) throws IOException, NativeLibraryException
      Write information about a this object to an XMLOutput stream. The way this method works must be consistent with SASLParametersProfile(XMLInput).
      Parameters:
      xmlOutput - XMLOutput stream
      Throws:
      IOException - if an error occurred when writing to the file
      NativeLibraryException
    • encryptSensitiveData

      public void encryptSensitiveData(String passphrase, String encryptionAlgorithm, String hashAlgorithm) throws NativeLibraryException
      This method will encrypt any sensitive data in the object. Specifically, it encrypts all values in the "callbackParams" and puts the encrypted values in "encryptedCallbackParams".

      This method is called by the BindProfileList when it is about to save data to disk.

      Parameters:
      passphrase - passphrase to use for encryption. Must not be null.
      encryptionAlgorithm - encryption algorithm
      hashAlgorithm - hash algorithm
      Throws:
      NativeLibraryException - if an unrecoverable error occurs in the native library
    • decryptSensitiveData

      public void decryptSensitiveData(String passphrase, String encryptionAlgorithm, String hashAlgorithm) throws NativeLibraryException
      This method will decrypt any sensitive data in the object. Specifically, it decrypts all values in the "toBeDecryptedCallbackParams" and puts the decrypted values in "callbackParams".

      This method is called by the BindProfileList after it's read a BindProfile file and knows what the encryption algorithms etc. are.

      Parameters:
      passphrase - passphrase for decryption. Must not be null.
      encryptionAlgorithm - encryption algorithm to use
      hashAlgorithm - hash algorithm to use
      Throws:
      NativeLibraryException - if an unrecoverable error occurs in the native library.