|
Multivalent API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmultivalent.std.adaptor.pdf.SecurityHandler
multivalent.std.adaptor.pdf.SecurityHandlerStandard
Implements "standard encryption" defined in Adobe's PDF Reference.
Bit masks for permission bits are given with PERM_ prefix.
| Field Summary | |
|---|---|
static int |
PERM_ALL
|
static int |
PERM_ANNO
Permission: Add or modify text annotations, fill in interactive form fields, and, if PERM_MODIFY is also set, create or modify interactive form fields (including signature fields). |
static int |
PERM_ASSEMBLE
Permission: (Revision 3 only) Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if PERM_MODIFY is clear. |
static int |
PERM_COPY
Permission: (Revision 2) Copy or otherwise extract text and graphics from the document, including extracting text and graphics (in support of accessibility to disabled users or for other purposes). |
static int |
PERM_COPY_R3
Permission: (Revision 3 only) Extract text and graphics (in support of accessibility to disabled users or for other purposes). |
static int |
PERM_DECRYPT
If the owner password was given, allow the document to be decrypted (extension to Adobe permission set). |
static int |
PERM_FILL
Permission: (Revision 3 only) Fill in existing interactive form fields (including signature fields), even if PERM_ANNO is clear. |
static int |
PERM_MODIFY
Permission: Modify the contents of the document by operations other than those controlled by PERM_ANNO, PERM_FILL, PERM_ASSEMBLE. |
static int |
PERM_NONE
|
static int |
PERM_PRINT
Permission: (Revision 2) Print the document. |
static int |
PERM_PRINT_GOOD
Permission: (Revision 3 only) Print the document to a representation from which a faithful digital copy of the PDF content could be generated. |
| Fields inherited from class multivalent.std.adaptor.pdf.SecurityHandler |
|---|
IDENTITY |
| Constructor Summary | |
|---|---|
SecurityHandlerStandard(byte[] key)
|
|
SecurityHandlerStandard(Dict edict,
COSSource coss)
|
|
SecurityHandlerStandard(java.lang.StringBuffer id0,
int R,
int P,
int Length,
java.lang.String userpassword,
java.lang.String ownerpassword)
Construct a Standard encryption filter with given parameters and passwords. |
|
| Method Summary | |
|---|---|
boolean |
authOwner(java.lang.String owner)
Algorithm 3.7 Authenticating the owner password. |
boolean |
authUser(java.lang.String user)
Algorithm 3.6 Authenticating the user password. |
java.lang.Object |
clone()
|
byte[] |
computeKey(java.lang.String password)
|
byte[] |
computeKey(java.lang.String password,
int keylen)
Algorithm 3.2 Computing an encryption key. |
java.lang.StringBuffer |
computeO(java.lang.String owner,
java.lang.String user)
Algorithm 3.3 Computing the encryption dictionary'’s O (owner password) value. |
java.lang.StringBuffer |
computeU(java.lang.String user)
Algorithm 3.4 Computing the encryption dictionary's U (user password) value (Revision 2), and Algorithm 3.5 Computing the encryption dictionary's U (user password) value (Revision 3) |
byte[] |
decrypt(byte[] data,
int off,
int len)
Decrypts stream data of object objnum with generation gennum. |
static byte[] |
encrypt(byte[] key,
byte[] data,
int off,
int len,
int objnum,
int gennum)
Algorithm 3.1 Encryption of data using an encryption key. |
byte[] |
encrypt(byte[] data,
int off,
int len)
Encrypts data of object objnum with generation gennum. |
byte[] |
getKey()
CryptFilter may take key from a security handler and use in Adobe algorithms. |
int |
getLength()
Returns length of encryption key. |
int |
getP()
Returns value of P field from dictionary. |
int |
getPerm()
Returns permission bits in effect. |
int |
getR()
Returns version of standard security handler. |
boolean |
isAuthorized()
Returns true if a valid decryption password, either user or owner, been set? |
protected static byte[] |
pad(java.lang.String str)
Algorithm 3.2, Step 1. |
SecurityHandler |
reset(int objnum,
int gennum)
Resets for decrypting/encrypting another subobject of object at given number. |
| Methods inherited from class multivalent.std.adaptor.pdf.SecurityHandler |
|---|
getInstance, register |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PERM_ALL
public static final int PERM_NONE
public static final int PERM_PRINT
PERM_PRINT_GOOD is also set.
public static final int PERM_MODIFY
PERM_ANNO, PERM_FILL, PERM_ASSEMBLE.
public static final int PERM_COPY
PERM_COPY_R3.
public static final int PERM_ANNO
PERM_MODIFY is also set, create or modify interactive form fields (including signature fields).
public static final int PERM_FILL
PERM_ANNO is clear.
public static final int PERM_COPY_R3
public static final int PERM_ASSEMBLE
PERM_MODIFY is clear.
public static final int PERM_PRINT_GOOD
PERM_PRINT is set), printing is limited to a lowlevel representation of the appearance, possibly of degraded quality.
public static final int PERM_DECRYPT
| Constructor Detail |
|---|
public SecurityHandlerStandard(Dict edict,
COSSource coss)
throws ParseException
ParseException
public SecurityHandlerStandard(java.lang.StringBuffer id0,
int R,
int P,
int Length,
java.lang.String userpassword,
java.lang.String ownerpassword)
public SecurityHandlerStandard(byte[] key)
| Method Detail |
|---|
public java.lang.Object clone()
clone in class SecurityHandlerpublic int getLength()
public int getR()
public int getP()
public int getPerm()
PERM_ALL;
else if the password was the user's, then this is identical to the /P field;
else if the password is invalid, then this is PERM_NONE.
If a bit position is 1 according to PERM_ bitmask, the user has that permission.
ContractualObligationpublic byte[] getKey()
SecurityHandler
getKey in class SecurityHandler
public byte[] encrypt(byte[] data,
int off,
int len)
SecurityHandler
encrypt in class SecurityHandler
public byte[] decrypt(byte[] data,
int off,
int len)
SecurityHandler
decrypt in class SecurityHandlerpublic boolean isAuthorized()
SecurityHandler
isAuthorized in class SecurityHandler
public SecurityHandler reset(int objnum,
int gennum)
SecurityHandler
reset in class SecurityHandler
public static byte[] encrypt(byte[] key,
byte[] data,
int off,
int len,
int objnum,
int gennum)
public byte[] computeKey(java.lang.String password)
computeKey in class SecurityHandler
public byte[] computeKey(java.lang.String password,
int keylen)
protected static byte[] pad(java.lang.String str)
public java.lang.StringBuffer computeO(java.lang.String owner,
java.lang.String user)
public java.lang.StringBuffer computeU(java.lang.String user)
public boolean authUser(java.lang.String user)
authUser in class SecurityHandlerpublic boolean authOwner(java.lang.String owner)
authOwner in class SecurityHandler
|
Multivalent API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||