public class CosEncryption extends Object
| Constructor and Description |
|---|
CosEncryption(CosDocument doc) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticateDecryption(DecryptedState decryptedState) |
InputByteStream |
decryptStream(ASName cryptFilter,
CosStream strObj,
InputByteStream content)
Get the decrypted contents of a stream.
|
byte[] |
decryptString(CosString strObj,
byte[] content)
Get the decrypted bytes for a string
|
InputByteStream |
encryptStream(ASName cryptFilter,
CosStream strObj,
InputByteStream content)
Get the encrypted contents of a stream.
|
byte[] |
encryptString(CosString strObj,
byte[] content)
Get the encrypted bytes for a string
|
Map |
getDecryptionMap() |
SecurityManager |
getDecryptionSecurityManager() |
SecurityHandler |
getDefaultDecryptionHandler()
Return the default decryption handler
|
CosDictionary |
getEncryption() |
EnableEncryption |
getEncryptionImpl()
Return the encryption implementation
|
Map |
getEncryptionMap() |
SecurityManager |
getEncryptionSecurityManager() |
boolean |
getEncryptionState() |
boolean |
needsDecryption() |
boolean |
needsEncryption() |
void |
resetDecryptionSecurityManager() |
void |
resetEncryptionSecurityManager() |
void |
setDecryptionAsEncryption()
Sets Security Manager for decryption equal to the Security Manager for encryption.
|
void |
setDecryptionSecurityManager(SecurityManager securityMgr) |
void |
setEncryptionSecurityManager(SecurityManager securityMgr,
Map encryptParams) |
boolean |
setEncryptionState(boolean doIt) |
boolean |
setNeedsDecryption(boolean decrypt) |
void |
setupDecryption() |
void |
setupEncryption()
Setup encryption
|
public CosEncryption(CosDocument doc)
public void setupDecryption()
throws PDFCosParseException,
PDFIOException,
PDFSecurityException
public boolean needsDecryption()
public boolean setNeedsDecryption(boolean decrypt)
public boolean needsEncryption()
public CosDictionary getEncryption()
public Map getDecryptionMap() throws PDFCosParseException, PDFIOException, PDFSecurityException
public Map getEncryptionMap() throws PDFSecurityAuthorizationException
public SecurityHandler getDefaultDecryptionHandler() throws PDFCosParseException, PDFSecurityException
public EnableEncryption getEncryptionImpl() throws PDFUnsupportedFeatureException
PDFUnsupportedFeatureException - if there is no encryption implementation
This represents a "can't happen" situationpublic SecurityManager getDecryptionSecurityManager()
public boolean authenticateDecryption(DecryptedState decryptedState) throws PDFSecurityException
PDFSecurityExceptionpublic void setDecryptionSecurityManager(SecurityManager securityMgr) throws PDFSecurityException, PDFCosParseException, PDFIOException
public SecurityManager getEncryptionSecurityManager()
public void setEncryptionSecurityManager(SecurityManager securityMgr, Map encryptParams)
public void setDecryptionAsEncryption()
throws PDFSecurityException,
PDFCosParseException,
PDFIOException
public void setupEncryption()
throws PDFCosParseException,
PDFIOException,
PDFSecurityException
PDFCosParseExceptionPDFIOExceptionPDFSecurityExceptionRuntimeException, - hard failure, if encryption was never requested
This represents a "can't happen" situationpublic void resetEncryptionSecurityManager()
public void resetDecryptionSecurityManager()
public byte[] encryptString(CosString strObj, byte[] content) throws PDFSecurityException
PDFUnsupportedFeatureException - if no encryption implementation is in placePDFSecurityExceptionpublic byte[] decryptString(CosString strObj, byte[] content) throws PDFSecurityException
PDFUnsupportedFeatureExceptionPDFSecurityExceptionPDFSecurityExceptionPDFUnsupportedFeatureException - if no encryption implementation is in placepublic InputByteStream decryptStream(ASName cryptFilter, CosStream strObj, InputByteStream content) throws PDFIOException, PDFSecurityException, PDFCosParseException
PDFIOExceptionPDFSecurityExceptionPDFCosParseExceptionPDFUnsupportedFeatureException - if no encryption implementation is in placepublic InputByteStream encryptStream(ASName cryptFilter, CosStream strObj, InputByteStream content) throws PDFCosParseException, PDFIOException, PDFSecurityException
InputByteStream.
If the caller desires to enrypt only a portion of an InputByteStream they should slice
the original InputByteStream. The returned encrypted stream becomes the property of the caller and
must be closed by them.PDFCosParseExceptionPDFIOExceptionPDFSecurityExceptionPDFUnsupportedFeatureException - if no encryption implementation is in placepublic boolean setEncryptionState(boolean doIt)
public boolean getEncryptionState()
Copyright © 2010 - 2020 Adobe. All Rights Reserved