|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.pdfview.decrypt.CryptFilterDecrypter
public class CryptFilterDecrypter
Implements Version 4 standard decryption, whereby the Encrypt dictionary
contains a list of named 'crypt filters', each of which is the equivalent
of a PDFDecrypter
. In addition to this list of crypt filters,
the name of the filter to use for streams and the default filter to use
for strings is specified. Requests to decode a stream with a named
decrypter (typically Identity) instead of the default decrypter
are honoured.
Constructor Summary | |
---|---|
CryptFilterDecrypter(java.util.Map<java.lang.String,PDFDecrypter> decrypters,
java.lang.String defaultStreamCryptName,
java.lang.String defaultStringCryptName)
Class constructor |
Method Summary | |
---|---|
java.nio.ByteBuffer |
decryptBuffer(java.lang.String cryptFilterName,
PDFObject streamObj,
java.nio.ByteBuffer streamBuf)
Decrypt a buffer of data |
java.lang.String |
decryptString(int objNum,
int objGen,
java.lang.String inputBasicString)
Decrypt a basic string . |
boolean |
isEncryptionPresent()
Determine whether this actually applies a decryption other than identity decryption. |
boolean |
isEncryptionPresent(java.lang.String cryptFilterName)
Determines whether decryption applies for a given crypt filter name |
boolean |
isOwnerAuthorised()
Determine whether the password known by the decrypter indicates that the user is the owner of the document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CryptFilterDecrypter(java.util.Map<java.lang.String,PDFDecrypter> decrypters, java.lang.String defaultStreamCryptName, java.lang.String defaultStringCryptName) throws PDFParseException
decrypters
- a map of crypt filter names to their corresponding
decrypters. Must already contain the Identity filter.defaultStreamCryptName
- the crypt filter name of the default
stream decrypterdefaultStringCryptName
- the crypt filter name of the default
string decrypter
PDFParseException
- if one of the named defaults is not
present in decryptersMethod Detail |
---|
public java.nio.ByteBuffer decryptBuffer(java.lang.String cryptFilterName, PDFObject streamObj, java.nio.ByteBuffer streamBuf) throws PDFParseException
PDFDecrypter
decryptBuffer
in interface PDFDecrypter
cryptFilterName
- the name of the crypt filter, if V4
encryption is being used, where individual crypt filters may
be specified for individual streams. If encryption is not using
V4 encryption (indicated by V=4 in the Encrypt dictionary) then
this must be null. Null may also be specified with V4 encryption
to indicate that the default filter should be used.streamObj
- the object whose stream is being decrypted. The
containing object's number and generation contribute to the key used for
stream encrypted with the document's default encryption, so this is
typically required. Should be null only if a cryptFilterName is
specified, as objects with specific stream filters use the general
document key, rather than a stream-specific key.streamBuf
- the buffer to decrypt
PDFParseException
- if the named crypt filter does not exist, or
if a crypt filter is named when named crypt filters are not supported.
Problems due to incorrect passwords are revealed prior to this point.public java.lang.String decryptString(int objNum, int objGen, java.lang.String inputBasicString) throws PDFParseException
PDFDecrypter
basic string
.
decryptString
in interface PDFDecrypter
objNum
- the object number of the containing objectobjGen
- the generation number of the containing objectinputBasicString
- the string to be decrypted
PDFParseException
- if the named crypt filter does not exist, or
if a crypt filter is named when named crypt filters are not supported.
Problems due to incorrect passwords are revealed prior to this point.public boolean isEncryptionPresent()
PDFDecrypter
isEncryptionPresent
in interface PDFDecrypter
public boolean isEncryptionPresent(java.lang.String cryptFilterName)
PDFDecrypter
isEncryptionPresent
in interface PDFDecrypter
cryptFilterName
- the crypt filter name
public boolean isOwnerAuthorised()
PDFDecrypter
PDFDecrypter.isEncryptionPresent()
to determine whether any
permissions apply.
isOwnerAuthorised
in interface PDFDecrypter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |