public class EncryptionInfo extends java.lang.Object implements GenericRecord
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ENCRYPTION_INFO_ENTRY
Document entry name for encryption info xml descriptor
(加密信息 xml 描述符的文档条目名称)
|
static BitField |
flagAES
A value that MUST be 1 if the protected content is an ECMA-376 document ECMA-376.
(如果受保护的内容是 ECMA-376 文档 ECMA-376,则该值必须为 1。)
|
static BitField |
flagCryptoAPI
A flag that specifies whether CryptoAPI RC4 or ECMA-376 encryption ECMA-376 is used.
(指定是否使用 CryptoAPI RC4 或 ECMA-376 加密 ECMA-376 的标志。)
|
static BitField |
flagDocProps
A value that MUST be 0 if document properties are encrypted.
(如果文档属性已加密,则该值必须为 0。)
|
static BitField |
flagExternal
A value that MUST be 1 if extensible encryption is used.
(如果使用可扩展加密,则该值必须为 1。)
|
Constructor and Description |
---|
EncryptionInfo(DirectoryNode dir)
Opens for decryption
|
EncryptionInfo(EncryptionInfo other) |
EncryptionInfo(EncryptionMode encryptionMode)
Prepares for encryption, using the given Encryption Mode, and all other parameters as default.
|
EncryptionInfo(EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)
Constructs an EncryptionInfo from scratch
|
EncryptionInfo(LittleEndianInput dis, EncryptionMode preferredEncryptionMode) |
EncryptionInfo(POIFSFileSystem fs)
Opens for decryption
|
Modifier and Type | Method and Description |
---|---|
EncryptionInfo |
copy() |
Decryptor |
getDecryptor() |
int |
getEncryptionFlags() |
EncryptionMode |
getEncryptionMode() |
Encryptor |
getEncryptor() |
java.util.Map<java.lang.String,java.util.function.Supplier<?>> |
getGenericProperties() |
EncryptionHeader |
getHeader() |
EncryptionVerifier |
getVerifier() |
int |
getVersionMajor() |
int |
getVersionMinor() |
boolean |
isDocPropsEncrypted() |
void |
setDecryptor(Decryptor decryptor) |
void |
setEncryptor(Encryptor encryptor) |
void |
setHeader(EncryptionHeader header) |
void |
setVerifier(EncryptionVerifier verifier) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getGenericChildren, getGenericRecordType
public static final java.lang.String ENCRYPTION_INFO_ENTRY
public static final BitField flagCryptoAPI
public static final BitField flagDocProps
public static final BitField flagExternal
public static final BitField flagAES
public EncryptionInfo(POIFSFileSystem fs) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public EncryptionInfo(DirectoryNode dir) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public EncryptionInfo(LittleEndianInput dis, EncryptionMode preferredEncryptionMode) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public EncryptionInfo(EncryptionMode encryptionMode)
public EncryptionInfo(EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)
encryptionMode
- see
EncryptionMode
for values,
EncryptionMode.cryptoAPI
is for internal use only, as it's record based
(encryptionMode - 有关值,请参阅 EncryptionMode,EncryptionMode.cryptoAPI 仅供内部使用,因为它是基于记录的)
cipherAlgorithm
- the cipher algorithm
(cipherAlgorithm - 密码算法)
hashAlgorithm
- the hash algorithm
(hashAlgorithm - 哈希算法)
keyBits
- the bit count of the key
(keyBits - 密钥的位数)
blockSize
- the size of a cipher block
(blockSize - 密码块的大小)
chainingMode
- the chaining mode
(chainingMode - 链接模式)
EncryptedDocumentException
- if the given parameters mismatch, e.g. only certain combinations of keyBits, blockSize are allowed for a given
CipherAlgorithm
(EncryptedDocumentException - 如果给定的参数不匹配,例如,对于给定的 CipherAlgorithm,只允许 keyBits、blockSize 的某些组合)
public EncryptionInfo(EncryptionInfo other)
public int getVersionMajor()
public int getVersionMinor()
public int getEncryptionFlags()
public EncryptionHeader getHeader()
public EncryptionVerifier getVerifier()
public Decryptor getDecryptor()
public Encryptor getEncryptor()
public void setHeader(EncryptionHeader header)
public void setVerifier(EncryptionVerifier verifier)
public void setDecryptor(Decryptor decryptor)
public void setEncryptor(Encryptor encryptor)
public EncryptionMode getEncryptionMode()
public boolean isDocPropsEncrypted()
EncryptedStream
stream, otherwise the Summaries aren't encrypted and located in their usual streams
(true,如果文档摘要/摘要已加密并存储在 EncryptedStream 流中,否则摘要未加密并位于其通常的流中)
public EncryptionInfo copy()
public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()
getGenericProperties
in interface
GenericRecord
(接口 GenericRecord 中的 getGenericProperties)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.