Package org.apache.fontbox.cff
Class Type1FontUtil
java.lang.Object
org.apache.fontbox.cff.Type1FontUtil
This class contains some helper methods handling Type1-Fonts.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
charstringDecrypt
(byte[] buffer, int n) Decrypt charstring.static byte[]
charstringEncrypt
(byte[] buffer, int n) Encrypt charstring.private static byte[]
decrypt
(byte[] ciphertextBytes, int r, int n) static byte[]
eexecDecrypt
(byte[] buffer) Decrypt eexec.static byte[]
eexecEncrypt
(byte[] buffer) Encrypt eexec.private static byte[]
encrypt
(byte[] plaintextBytes, int r, int n) static byte[]
Converts a string representing a hex value into a byte array.static String
hexEncode
(byte[] bytes) Converts a byte-array into a string with the corresponding hex value.
-
Constructor Details
-
Type1FontUtil
private Type1FontUtil()
-
-
Method Details
-
hexEncode
Converts a byte-array into a string with the corresponding hex value.- Parameters:
bytes
- the byte array- Returns:
- the string with the hex value
-
hexDecode
Converts a string representing a hex value into a byte array.- Parameters:
string
- the string representing the hex value- Returns:
- the hex value as byte array
-
eexecEncrypt
public static byte[] eexecEncrypt(byte[] buffer) Encrypt eexec.- Parameters:
buffer
- the given data- Returns:
- the encrypted data
-
charstringEncrypt
public static byte[] charstringEncrypt(byte[] buffer, int n) Encrypt charstring.- Parameters:
buffer
- the given datan
- blocksize?- Returns:
- the encrypted data
-
encrypt
private static byte[] encrypt(byte[] plaintextBytes, int r, int n) -
eexecDecrypt
public static byte[] eexecDecrypt(byte[] buffer) Decrypt eexec.- Parameters:
buffer
- the given encrypted data- Returns:
- the decrypted data
-
charstringDecrypt
public static byte[] charstringDecrypt(byte[] buffer, int n) Decrypt charstring.- Parameters:
buffer
- the given encrypted datan
- blocksize?- Returns:
- the decrypted data
-
decrypt
private static byte[] decrypt(byte[] ciphertextBytes, int r, int n)
-