Class GatewaySec
java.lang.Object
com.inductiveautomation.ignition.common.GatewaySec
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
Returns the encoding key specified by -DencodingKey, otherwise returns the default.static byte[]
decrypt
(byte[] toDecrypt) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3static byte[]
decrypt
(byte[] toDecrypt, byte[] encodingKey) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3static String
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3static String
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3static byte[]
encrypt
(byte[] toEncrypt) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3static byte[]
encrypt
(byte[] toEncrypt, byte[] encodingKey) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3static String
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3static String
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3
-
Method Details
-
encrypt
@Deprecated(since="8.1.48", forRemoval=true) public static String encrypt(String toEncrypt) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3Performs symmetric encryption using DESede. Uses ECB mode and PKCS5 padding. Encrypts the bytes of the given string, and returns the results using hex encoding. Uses the default encryption key. This should be used when dealing with clients.- Parameters:
toEncrypt
- A String to encrypt. Must not be null. The byte array from UTF-8-encoding the String is encrypted.- Returns:
- a String containing the hex-encoded encrypted data
- Throws:
Exception
- if the key is invalid, the block size is incorrect, or the padding is bad- See Also:
-
encrypt
@Deprecated(since="8.1.48", forRemoval=true) public static byte[] encrypt(byte[] toEncrypt) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3Performs symmetric encryption using DESede. Uses ECB mode and PKCS5 padding. Uses the default encryption key. This should be used when dealing with clients.- Parameters:
toEncrypt
- A byte array to encrypt. Must not be null- Returns:
- a byte array containing the encrypted data
- Throws:
Exception
- if the key is invalid, the block size is incorrect, or the padding is bad- See Also:
-
encrypt
@Deprecated(since="8.1.48", forRemoval=true) public static String encrypt(String toEncrypt, byte[] encodingKey) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3Performs symmetric encryption using DESede. Uses ECB mode and PKCS5 padding.- Parameters:
toEncrypt
- A String to encrypt. Must not be null. The byte array from UTF-8-encoding the String is encrypted.encodingKey
- The key to use. must be 24 bytes long- Returns:
- a String containing the hex-encoded encrypted data
- Throws:
Exception
- if the key is invalid, the block size is incorrect, or the padding is bad- See Also:
-
encrypt
@Deprecated(since="8.1.48", forRemoval=true) public static byte[] encrypt(byte[] toEncrypt, byte[] encodingKey) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3Performs symmetric encryption using DESede. Uses ECB mode and PKCS5 padding.- Parameters:
toEncrypt
- A byte array to encrypt. Must not be nullencodingKey
- The key to use. must be 24 bytes long- Returns:
- a byte array containing the encrypted data
- Throws:
Exception
- if the key is invalid, the block size is incorrect, or the padding is bad- See Also:
-
decrypt
@Deprecated(since="8.1.48", forRemoval=true) public static String decrypt(String toDecrypt) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3Performs symmetric decryption using DESede. Uses ECB mode and PKCS5 padding. Uses the default encryption key. This should be used when dealing with clients.- Parameters:
toDecrypt
- a String to decrypt. Must not be null. The String must be hex-encoded. The hex-decoded byte array is decrypted.- Returns:
- a String containing the decrypted data. the String is the UTF-8 decoding of the decrypted byte array.
- Throws:
Exception
- if the key is invalid, the block size is incorrect, or the padding is bad- See Also:
-
decrypt
@Deprecated(since="8.1.48", forRemoval=true) public static byte[] decrypt(byte[] toDecrypt) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3Performs symmetric decryption using DESede. Uses ECB mode and PKCS5 padding. Uses the default encryption key. This should be used when dealing with clients.- Parameters:
toDecrypt
- a byte[] to decrypt. Must not be null- Returns:
- a byte array containing the decrypted data
- Throws:
Exception
- if the key is invalid, the block size is incorrect, or the padding is bad- See Also:
-
decrypt
@Deprecated(since="8.1.48", forRemoval=true) public static String decrypt(String toDecrypt, byte[] encodingKey) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3Performs symmetric decryption using DESede. Uses ECB mode and PKCS5 padding.- Parameters:
toDecrypt
- a String to decrypt. Must not be null. The String must be hex-encoded. The hex-decoded byte array is decrypted.encodingKey
- The key to use. must be 24 bytes long- Returns:
- a String containing the decrypted data. the String is the UTF-8 decoding of the decrypted byte array.
- Throws:
Exception
- if the key is invalid, the block size is incorrect, or the padding is bad- See Also:
-
decrypt
@Deprecated(since="8.1.48", forRemoval=true) public static byte[] decrypt(byte[] toDecrypt, byte[] encodingKey) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.Deprecated for removal in the next major version after 8.3Performs symmetric decryption using DESede. Uses ECB mode and PKCS5 padding.- Parameters:
toDecrypt
- a byte[] to decrypt. Must not be nullencodingKey
- The key to use. must be 24 bytes long- Returns:
- a byte array containing the decrypted data
- Throws:
Exception
- if the key is invalid, the block size is incorrect, or the padding is bad- See Also:
-
customKeyOrDefault
public static byte[] customKeyOrDefault()Returns the encoding key specified by -DencodingKey, otherwise returns the default.
-