|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.pdf.PdfEncryption
public class PdfEncryption
Field Summary | |
---|---|
static int |
AES_128
|
private ARCFOUREncryption |
arcfour
|
private int |
cryptoMode
|
(package private) byte[] |
documentID
|
private boolean |
embeddedFilesOnly
Indicates if the encryption is only necessary for embedded files. |
private boolean |
encryptMetadata
|
(package private) byte[] |
extra
Work area to prepare the object/generation bytes |
(package private) byte[] |
key
The encryption key for a particular object/generation |
private int |
keyLength
The generic key length. |
(package private) int |
keySize
The encryption key length for a particular object/generation |
(package private) MessageDigest |
md5
The message digest algorithm MD5 |
private static byte[] |
metadataPad
|
(package private) byte[] |
mkey
The global encryption key |
(package private) byte[] |
ownerKey
The encryption key for the owner |
private static byte[] |
pad
|
(package private) int |
permissions
|
protected PdfPublicKeySecurityHandler |
publicKeyHandler
The public key security handler for certificate encryption |
private int |
revision
|
private static byte[] |
salt
|
(package private) static long |
seq
|
static int |
STANDARD_ENCRYPTION_128
|
static int |
STANDARD_ENCRYPTION_40
|
(package private) byte[] |
userKey
The encryption key for the user |
Constructor Summary | |
---|---|
PdfEncryption()
|
|
PdfEncryption(PdfEncryption enc)
|
Method Summary | |
---|---|
void |
addRecipient(Certificate cert,
int permission)
|
int |
calculateStreamSize(int n)
|
private byte[] |
computeOwnerKey(byte[] userPad,
byte[] ownerPad)
|
byte[] |
computeUserPassword(byte[] ownerPassword)
|
static byte[] |
createDocumentId()
|
static PdfObject |
createInfoId(byte[] id)
|
byte[] |
decryptByteArray(byte[] b)
|
byte[] |
encryptByteArray(byte[] b)
|
int |
getCryptoMode()
|
StandardDecryption |
getDecryptor()
|
PdfDictionary |
getEncryptionDictionary()
|
OutputStreamEncryption |
getEncryptionStream(OutputStream os)
|
PdfObject |
getFileID()
|
boolean |
isEmbeddedFilesOnly()
Indicates if only the embedded files have to be encrypted. |
boolean |
isMetadataEncrypted()
|
private byte[] |
padPassword(byte[] userPassword)
|
void |
setCryptoMode(int mode,
int kl)
|
void |
setHashKey(int number,
int generation)
|
void |
setupAllKeys(byte[] userPassword,
byte[] ownerPassword,
int permissions)
|
void |
setupByEncryptionKey(byte[] key,
int keylength)
|
private void |
setupByOwnerPad(byte[] documentID,
byte[] ownerPad,
byte[] userKey,
byte[] ownerKey,
int permissions)
|
void |
setupByOwnerPassword(byte[] documentID,
byte[] ownerPassword,
byte[] userKey,
byte[] ownerKey,
int permissions)
|
private void |
setupByUserPad(byte[] documentID,
byte[] userPad,
byte[] ownerKey,
int permissions)
|
void |
setupByUserPassword(byte[] documentID,
byte[] userPassword,
byte[] ownerKey,
int permissions)
|
private void |
setupGlobalEncryptionKey(byte[] documentID,
byte[] userPad,
byte[] ownerKey,
int permissions)
ownerKey, documentID must be setup |
private void |
setupUserKey()
mkey must be setup |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STANDARD_ENCRYPTION_40
public static final int STANDARD_ENCRYPTION_128
public static final int AES_128
private static final byte[] pad
private static final byte[] salt
private static final byte[] metadataPad
byte[] key
int keySize
byte[] mkey
byte[] extra
MessageDigest md5
byte[] ownerKey
byte[] userKey
protected PdfPublicKeySecurityHandler publicKeyHandler
int permissions
byte[] documentID
static long seq
private int revision
private ARCFOUREncryption arcfour
private int keyLength
private boolean encryptMetadata
private boolean embeddedFilesOnly
private int cryptoMode
Constructor Detail |
---|
public PdfEncryption()
public PdfEncryption(PdfEncryption enc)
Method Detail |
---|
public void setCryptoMode(int mode, int kl)
public int getCryptoMode()
public boolean isMetadataEncrypted()
public boolean isEmbeddedFilesOnly()
private byte[] padPassword(byte[] userPassword)
private byte[] computeOwnerKey(byte[] userPad, byte[] ownerPad)
private void setupGlobalEncryptionKey(byte[] documentID, byte[] userPad, byte[] ownerKey, int permissions)
private void setupUserKey()
public void setupAllKeys(byte[] userPassword, byte[] ownerPassword, int permissions)
public static byte[] createDocumentId()
public void setupByUserPassword(byte[] documentID, byte[] userPassword, byte[] ownerKey, int permissions)
private void setupByUserPad(byte[] documentID, byte[] userPad, byte[] ownerKey, int permissions)
public void setupByOwnerPassword(byte[] documentID, byte[] ownerPassword, byte[] userKey, byte[] ownerKey, int permissions)
private void setupByOwnerPad(byte[] documentID, byte[] ownerPad, byte[] userKey, byte[] ownerKey, int permissions)
public void setupByEncryptionKey(byte[] key, int keylength)
public void setHashKey(int number, int generation)
public static PdfObject createInfoId(byte[] id)
public PdfDictionary getEncryptionDictionary()
public PdfObject getFileID()
public OutputStreamEncryption getEncryptionStream(OutputStream os)
public int calculateStreamSize(int n)
public byte[] encryptByteArray(byte[] b)
public StandardDecryption getDecryptor()
public byte[] decryptByteArray(byte[] b)
public void addRecipient(Certificate cert, int permission)
public byte[] computeUserPassword(byte[] ownerPassword)
|
Hosted by Hostbasket | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |