|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.pdf.crypt.AbstractSecurityHandler
de.intarsys.pdf.crypt.StandardSecurityHandler
public abstract class StandardSecurityHandler
The standard security handler as specified in the PDF reference.
It supports the implementation up to and including revision 4.
Field Summary | |
---|---|
static int |
DEFAULT_ACCESS_PERMISSIONS
The default value for the access permission flags. |
static COSName |
DK_EncryptMetadata
|
static COSName |
DK_O
|
static COSName |
DK_P
|
static COSName |
DK_R
|
static COSName |
DK_U
|
Constructor Summary | |
---|---|
StandardSecurityHandler()
|
Method Summary | |
---|---|
void |
authenticate(IPasswordProvider passwordProvider)
Perform an authentication of the current "user" on behalf of the information in the encryption dictionary. |
byte[] |
decrypt(COSObjectKey key,
byte[] bytes)
Decrypt any bytes in the context of COSObject referenced by the provided key. |
byte[] |
encrypt(COSObjectKey key,
byte[] bytes)
Encrypt any bytes in the context of COSObject referenced by the provided key. |
IAccessPermissions |
getAccessPermissions()
The access permissions encoded in the encryption object for the current document or null if not applicable. |
byte[] |
getCryptKey()
|
void |
init(STDocument document,
COSEncryption encryption)
|
Methods inherited from class de.intarsys.pdf.crypt.AbstractSecurityHandler |
---|
getEncryption |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final COSName DK_O
public static final COSName DK_P
public static final COSName DK_R
public static final COSName DK_U
public static final COSName DK_EncryptMetadata
public static final int DEFAULT_ACCESS_PERMISSIONS
Everything is allowed, only the reserved flags are zero.
Constructor Detail |
---|
public StandardSecurityHandler()
Method Detail |
---|
public void authenticate(IPasswordProvider passwordProvider) throws COSSecurityException
ISecurityHandler
In most situations this will consist of checking user/owner password and setting the resulting access permissions.
COSSecurityException
public IAccessPermissions getAccessPermissions()
ISecurityHandler
The access permissions are not standardized, may be these are not available from arbitrary handlers.
public byte[] getCryptKey()
public void init(STDocument document, COSEncryption encryption) throws COSSecurityException
init
in interface ISecurityHandler
init
in class AbstractSecurityHandler
COSSecurityException
public byte[] decrypt(COSObjectKey key, byte[] bytes) throws COSSecurityException
ICryptHandler
key
- of the object which provides the contextbytes
- to decrypt
COSSecurityException
public byte[] encrypt(COSObjectKey key, byte[] bytes) throws COSSecurityException
ICryptHandler
key
- of the object which provides the contextbytes
- to decrypt
COSSecurityException
|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |