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.
(加密 Document-/SummaryInformation 和其他可选流。)
|
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
(类 Encryptor 中的 confirmPassword)
public void confirmPassword(java.lang.String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt)
confirmPassword
in class
Encryptor
(类 Encryptor 中的 confirmPassword)
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 index
(cipher - 可以为空,否则给定的实例被重置为新的块索引)
block
- the block index, e.g. the persist/slide id (hslf)
(block - 块索引,例如持久化/幻灯片 id (hslf))
java.security.GeneralSecurityException
- when the cipher can't be initialized
(java.security.GeneralSecurityException - 当密码无法初始化时)
public ChunkedCipherOutputStream getDataStream(DirectoryNode dir) throws java.io.IOException
Encryptor
getDataStream
in class
Encryptor
(类 Encryptor 中的 getDataStream)
dir
- the node to write to
(dir - 要写入的节点)
java.io.IOException
(java.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.io.IOException)
java.security.GeneralSecurityException
(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.io.IOException)
java.security.GeneralSecurityException
(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 key
(chunkSize - 块大小,即具有相同加密密钥的块大小)
public CryptoAPIEncryptor copy()
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.