Class EncryptionServices

    • Constructor Detail

      • EncryptionServices

        public EncryptionServices()
    • Method Detail

      • Encrypt

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

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

        @Deprecated
        @ThingworxExtensionApiMethod(since={6,6},
                                     deprecatedSince={8,3})
        public java.lang.String EncryptWithKey​(java.lang.String key,
                                               java.lang.String data)
                                        throws java.lang.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:
        java.lang.Exception - emit errors
      • DecryptWithKey

        @Deprecated
        @ThingworxExtensionApiMethod(since={6,6},
                                     deprecatedSince={8,3})
        public java.lang.String DecryptWithKey​(java.lang.String key,
                                               java.lang.String data)
                                        throws java.lang.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:
        java.lang.Exception - emit errors
      • GenerateKey

        @ThingworxExtensionApiMethod(since={8,3})
        public java.lang.String GenerateKey​(java.lang.Integer size)
                                     throws java.lang.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:
        java.lang.Exception - If an error occurs
      • EncryptWithCustomKey

        @ThingworxExtensionApiMethod(since={8,3})
        public java.lang.String EncryptWithCustomKey​(java.lang.String key,
                                                     java.lang.String data)
                                              throws java.lang.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:
        java.lang.Exception - If an error occurs
      • DecryptWithCustomKey

        @ThingworxExtensionApiMethod(since={8,3})
        public java.lang.String DecryptWithCustomKey​(java.lang.String key,
                                                     java.lang.String encryptedData)
                                              throws java.lang.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:
        java.lang.Exception - If an error occurs