Class EncryptionServices

All Implemented Interfaces:
IConfigurableObject, INotScriptFriendly, ISupportsDeprecation, IDiffableObject, IAvatar, IEntityLifeCycleEvent, IPersistable, IServiceProvider, ITaggableObject, IDependencyScannableObject, IEntityDefinition, IPersistableObject<String>, IDesignTimeSecurable, IDesignTimeSecurableEntity, IRunTimeSecurable, IRunTimeSecurableEntity, ISecurable, IVisibilitySecurable, IVisibilitySecurableEntity, IAspectContainer, INamedObject, Serializable

@ThingworxExtensionApiClass(since={6,6}, canInstantiate=true) public class EncryptionServices extends Resource
See Also:
  • Constructor Details

    • EncryptionServices

      public EncryptionServices()
  • Method Details

    • Encrypt

      @ThingworxExtensionApiMethod(since={6,6}) public String Encrypt(String data) throws Exception
      Service Category:
      Encryption
      Service Description:
      Returns an encrypted password.
      Parameters:
      data - Data to encrypt - STRING
      Returns:
      result Encrypted data - STRING
      Throws:
      Exception - If an error occurs
    • EncryptPropertyValue

      @ThingworxExtensionApiMethod(since={6,6}) public String EncryptPropertyValue(String data) throws Exception
      Service Category:
      Encryption
      Service Description:
      Returns an encrypted property value.
      Parameters:
      data - Data to encrypt - STRING
      Returns:
      result Encrypted data - STRING
      Throws:
      Exception - If an error occurs
    • EncryptWithKey

      @Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,3}) public String EncryptWithKey(String key, String data) throws Exception
      Deprecated.
      Service Category:
      Encryption
      Service Description:
      Returns an encrypted string using a specified key. This service is deprecated since release 8.3. Please use EncryptWithCustomKey service instead.


      Returns an encrypted string using a specified key, which is a 56 hex characters string.
      Parameters:
      key - Encryption key to use (56 hex characters)
      data - Data to encrypt
      Returns:
      Returns an encrypted string using a specified key
      Throws:
      Exception - emit errors
    • DecryptWithKey

      @Deprecated @ThingworxExtensionApiMethod(since={6,6}, deprecatedSince={8,3}) public String DecryptWithKey(String key, String data) throws Exception
      Deprecated.
      Service Category:
      Encryption
      Service Description:
      Returns an decrypted string using a specified key. This service is deprecated since release 8.3. Please use DecryptWithCustomKey service instead.


      Returns an decrypted string using a specified key, which is a 56 hex characters string.
      Parameters:
      key - Encryption key to use (56 hex characters)
      data - Data to decrypt
      Returns:
      Returns an decrypted string using a specified key
      Throws:
      Exception - emit errors
    • GenerateKey

      @ThingworxExtensionApiMethod(since={8,3}) public String GenerateKey(Integer size) throws Exception
      Service Category:
      Encryption
      Service Description:
      Returns a Base64 encoded AES encryption key. Supports AES key sizes, i.e. 128, 192 or 256 bits.
      Parameters:
      size - Size of the key to be generated in bits. Supported key sizes are 128, 192 and 256 bits - INTEGER
      Returns:
      key Base64 encoded key - STRING
      Throws:
      Exception - If an error occurs
    • EncryptWithCustomKey

      @ThingworxExtensionApiMethod(since={8,3}) public String EncryptWithCustomKey(String key, String data) throws Exception
      Service Category:
      Encryption
      Service Description:
      Returns an encrypted string using a Base64 encoded key with AES 128 supported key lengths; 128, 192 or 256 bits.
      Parameters:
      key - Based64 encoded key with key size of 128, 192 or 256 bits - STRING
      data - Plain text data to encrypt - STRING
      Returns:
      result Encrypted data - STRING
      Throws:
      Exception - If an error occurs
    • DecryptWithCustomKey

      @ThingworxExtensionApiMethod(since={8,3}) public String DecryptWithCustomKey(String key, String encryptedData) throws Exception
      Service Category:
      Encryption
      Service Description:
      Returns decrypted data using the Base64 encoded key with valid sizes; 128, 192 or 256 bits.
      Parameters:
      key - Based64 encoded key with sizes of 128, 192 or 256 bits - STRING
      encryptedData - Data encrypted using Thingworx EncryptWithCustomKey service - STRING
      Returns:
      result Decrypted data - STRING
      Throws:
      Exception - If an error occurs