org.apache.poi.poifs.crypt
Class EncryptionInfo

java.lang.Object
  extended by org.apache.poi.poifs.crypt.EncryptionInfo

public class EncryptionInfo
extends java.lang.Object


Field Summary
static BitField flagAES
          A value that MUST be 1 if the protected content is an ECMA-376 document ECMA-376.
static BitField flagCryptoAPI
          A flag that specifies whether CryptoAPI RC4 or ECMA-376 encryption ECMA-376 is used.
static BitField flagDocProps
          A value that MUST be 0 if document properties are encrypted.
static BitField flagExternal
          A value that MUST be 1 if extensible encryption is used.
 
Constructor Summary
EncryptionInfo(DirectoryNode dir)
          Opens for decryption
EncryptionInfo(DirectoryNode dir, EncryptionMode encryptionMode)
          Deprecated. Use EncryptionInfo(EncryptionMode) (dir parameter no longer required)
EncryptionInfo(DirectoryNode dir, EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)
          Deprecated. use EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)
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, boolean isCryptoAPI)
           
EncryptionInfo(NPOIFSFileSystem fs)
          Opens for decryption
EncryptionInfo(NPOIFSFileSystem fs, EncryptionMode encryptionMode)
          Deprecated. Use EncryptionInfo(EncryptionMode) (fs parameter no longer required)
EncryptionInfo(NPOIFSFileSystem fs, EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)
          Deprecated. use EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)
EncryptionInfo(OPOIFSFileSystem fs)
          Opens for decryption
EncryptionInfo(POIFSFileSystem fs)
          Opens for decryption
EncryptionInfo(POIFSFileSystem fs, EncryptionMode encryptionMode)
          Deprecated. Use EncryptionInfo(EncryptionMode) (fs parameter no longer required)
EncryptionInfo(POIFSFileSystem fs, EncryptionMode encryptionMode, CipherAlgorithm cipherAlgorithm, HashAlgorithm hashAlgorithm, int keyBits, int blockSize, ChainingMode chainingMode)
          Deprecated. use EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)
 
Method Summary
protected static EncryptionInfoBuilder getBuilder(EncryptionMode encryptionMode)
           
 Decryptor getDecryptor()
           
 int getEncryptionFlags()
           
 Encryptor getEncryptor()
           
 EncryptionHeader getHeader()
           
 EncryptionVerifier getVerifier()
           
 int getVersionMajor()
           
 int getVersionMinor()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flagCryptoAPI

public static final BitField flagCryptoAPI
A flag that specifies whether CryptoAPI RC4 or ECMA-376 encryption ECMA-376 is used. It MUST be 1 unless flagExternal is 1. If flagExternal is 1, it MUST be 0.


flagDocProps

public static final BitField flagDocProps
A value that MUST be 0 if document properties are encrypted. The encryption of document properties is specified in section 2.3.5.4.


flagExternal

public static final BitField flagExternal
A value that MUST be 1 if extensible encryption is used. If this value is 1, the value of every other field in this structure MUST be 0.


flagAES

public static final BitField flagAES
A value that MUST be 1 if the protected content is an ECMA-376 document ECMA-376. If the fAES bit is 1, the fCryptoAPI bit MUST also be 1.

Constructor Detail

EncryptionInfo

public EncryptionInfo(POIFSFileSystem fs)
               throws java.io.IOException
Opens for decryption

Throws:
java.io.IOException

EncryptionInfo

public EncryptionInfo(OPOIFSFileSystem fs)
               throws java.io.IOException
Opens for decryption

Throws:
java.io.IOException

EncryptionInfo

public EncryptionInfo(NPOIFSFileSystem fs)
               throws java.io.IOException
Opens for decryption

Throws:
java.io.IOException

EncryptionInfo

public EncryptionInfo(DirectoryNode dir)
               throws java.io.IOException
Opens for decryption

Throws:
java.io.IOException

EncryptionInfo

public EncryptionInfo(LittleEndianInput dis,
                      boolean isCryptoAPI)
               throws java.io.IOException
Throws:
java.io.IOException

EncryptionInfo

@Deprecated
public EncryptionInfo(POIFSFileSystem fs,
                                 EncryptionMode encryptionMode)
Deprecated. Use EncryptionInfo(EncryptionMode) (fs parameter no longer required)


EncryptionInfo

@Deprecated
public EncryptionInfo(NPOIFSFileSystem fs,
                                 EncryptionMode encryptionMode)
Deprecated. Use EncryptionInfo(EncryptionMode) (fs parameter no longer required)


EncryptionInfo

@Deprecated
public EncryptionInfo(DirectoryNode dir,
                                 EncryptionMode encryptionMode)
Deprecated. Use EncryptionInfo(EncryptionMode) (dir parameter no longer required)


EncryptionInfo

@Deprecated
public EncryptionInfo(POIFSFileSystem fs,
                                 EncryptionMode encryptionMode,
                                 CipherAlgorithm cipherAlgorithm,
                                 HashAlgorithm hashAlgorithm,
                                 int keyBits,
                                 int blockSize,
                                 ChainingMode chainingMode)
Deprecated. use EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)


EncryptionInfo

@Deprecated
public EncryptionInfo(NPOIFSFileSystem fs,
                                 EncryptionMode encryptionMode,
                                 CipherAlgorithm cipherAlgorithm,
                                 HashAlgorithm hashAlgorithm,
                                 int keyBits,
                                 int blockSize,
                                 ChainingMode chainingMode)
Deprecated. use EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)


EncryptionInfo

@Deprecated
public EncryptionInfo(DirectoryNode dir,
                                 EncryptionMode encryptionMode,
                                 CipherAlgorithm cipherAlgorithm,
                                 HashAlgorithm hashAlgorithm,
                                 int keyBits,
                                 int blockSize,
                                 ChainingMode chainingMode)
Deprecated. use EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)


EncryptionInfo

public EncryptionInfo(EncryptionMode encryptionMode)
Prepares for encryption, using the given Encryption Mode, and all other parameters as default.

See Also:
EncryptionInfo(EncryptionMode, CipherAlgorithm, HashAlgorithm, int, int, ChainingMode)

EncryptionInfo

public EncryptionInfo(EncryptionMode encryptionMode,
                      CipherAlgorithm cipherAlgorithm,
                      HashAlgorithm hashAlgorithm,
                      int keyBits,
                      int blockSize,
                      ChainingMode chainingMode)
Constructs an EncryptionInfo from scratch

Parameters:
encryptionMode - see EncryptionMode for values, EncryptionMode.cryptoAPI is for internal use only, as it's record based
cipherAlgorithm -
hashAlgorithm -
keyBits -
blockSize -
chainingMode -
Throws:
EncryptedDocumentException - if the given parameters mismatch, e.g. only certain combinations of keyBits, blockSize are allowed for a given CipherAlgorithm
Method Detail

getBuilder

protected static EncryptionInfoBuilder getBuilder(EncryptionMode encryptionMode)
                                           throws java.lang.ClassNotFoundException,
                                                  java.lang.IllegalAccessException,
                                                  java.lang.InstantiationException
Throws:
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException

getVersionMajor

public int getVersionMajor()

getVersionMinor

public int getVersionMinor()

getEncryptionFlags

public int getEncryptionFlags()

getHeader

public EncryptionHeader getHeader()

getVerifier

public EncryptionVerifier getVerifier()

getDecryptor

public Decryptor getDecryptor()

getEncryptor

public Encryptor getEncryptor()


Copyright 2015 The Apache Software Foundation or its licensors, as applicable.