共用方式為


EncryptionUtility Class

  • java.lang.Object
    • system.fabric.EncryptionUtility

public class EncryptionUtility

Utility class to perform encryption and decryption operations.

Method Summary

Modifier and Type Method and Description
char [] decryptText(String textToDecrypt)

Decrypted the encrypted text. The certificate(.pem) file should be present in the /var/lib/sfcerts folder.

String encryptText(char []textToEncrypt, String certPath)

Encrypts the text with the given certificate file.

String encryptText(char []textToEncrypt, String certPath, String algorithmOid)

Encrypts the text with the given certificate file.

String encryptText(String textToEncrypt, String certPath)

Encrypts the text with the given certificate file.

String encryptText(String textToEncrypt, String certPath, String algorithmOid)

Encrypts the text with the given certificate file.

Method Details

decryptText

public static char [] decryptText(String textToDecrypt)

Decrypted the encrypted text. The certificate(.pem) file should be present in the /var/lib/sfcerts folder.

Parameters:

textToDecrypt - The text to decrypt.

Returns:

The decrypted text as char array.

encryptText

public static String encryptText(char []textToEncrypt, String certPath)

Encrypts the text with the given certificate file.

Parameters:

textToEncrypt - The text to encrypt.
certPath - Path of the certificate(.pem) file to be used for encryption.

Returns:

The encrypted string.

encryptText

public static String encryptText(char []textToEncrypt, String certPath, String algorithmOid)

Encrypts the text with the given certificate file.

Parameters:

textToEncrypt - The text to encrypt.
certPath - Path of the certificate(.pem) file to be used for encryption.
algorithmOid - The encryption algorithm object identifier (OID).

Returns:

The encrypted string.

encryptText

public static String encryptText(String textToEncrypt, String certPath)

Encrypts the text with the given certificate file.

Parameters:

textToEncrypt - The text to encrypt.
certPath - Path of the certificate(.pem) file to be used for encryption.

Returns:

The encrypted string.

encryptText

public static String encryptText(String textToEncrypt, String certPath, String algorithmOid)

Encrypts the text with the given certificate file.

Parameters:

textToEncrypt - The text to encrypt.
certPath - Path of the certificate(.pem) file to be used for encryption.
algorithmOid - The encryption algorithm object identifier (OID).

Returns:

The encrypted string.

Applies to