public class CryptoAPIEncryptor extends Encryptor
Modifier and Type | Class and Description |
---|---|
protected class |
CryptoAPIEncryptor.CryptoAPICipherOutputStream |
DEFAULT_POIFS_ENTRY
Modifier and Type | Method and Description |
---|---|
void |
confirmPassword(java.lang.String password) |
void |
confirmPassword(java.lang.String password,
byte[] keySpec,
byte[] keySalt,
byte[] verifier,
byte[] verifierSalt,
byte[] integritySalt) |
CryptoAPIEncryptor |
copy() |
ChunkedCipherOutputStream |
getDataStream(DirectoryNode dir)
Return a output stream for encrypted data.
|
CryptoAPIEncryptor.CryptoAPICipherOutputStream |
getDataStream(java.io.OutputStream stream,
int initialOffset) |
javax.crypto.Cipher |
initCipherForBlock(javax.crypto.Cipher cipher,
int block)
Initializes a cipher object for a given block index for encryption
|
void |
setChunkSize(int chunkSize)
Sets the chunk size of the data stream.
|
void |
setSummaryEntries(DirectoryNode dir,
java.lang.String encryptedStream,
POIFSFileSystem entries)
Encrypt the Document-/SummaryInformation and other optionally streams.
|
getDataStream, getEncryptionInfo, getGenericProperties, getInstance, getSecretKey, setEncryptionInfo, setSecretKey
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getGenericChildren, getGenericRecordType
public void confirmPassword(java.lang.String password)
confirmPassword
in class Encryptor
public void confirmPassword(java.lang.String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt)
confirmPassword
in class Encryptor
public javax.crypto.Cipher initCipherForBlock(javax.crypto.Cipher cipher, int block) throws java.security.GeneralSecurityException
cipher
- may be null, otherwise the given instance is reset to the new block indexblock
- the block index, e.g. the persist/slide id (hslf)java.security.GeneralSecurityException
- when the cipher can't be initializedpublic ChunkedCipherOutputStream getDataStream(DirectoryNode dir) throws java.io.IOException
Encryptor
getDataStream
in class Encryptor
dir
- the node to write tojava.io.IOException
public CryptoAPIEncryptor.CryptoAPICipherOutputStream getDataStream(java.io.OutputStream stream, int initialOffset) throws java.io.IOException, java.security.GeneralSecurityException
getDataStream
in class Encryptor
java.io.IOException
java.security.GeneralSecurityException
public void setSummaryEntries(DirectoryNode dir, java.lang.String encryptedStream, POIFSFileSystem entries) throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
java.security.GeneralSecurityException
public void setChunkSize(int chunkSize)
Encryptor
setChunkSize
in class Encryptor
chunkSize
- the chunk size, i.e. the block size with the same encryption keypublic CryptoAPIEncryptor copy()
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.