Top Fields Constructors Methods
org.apache.poi.poifs.crypt

public abstract Class Encryptor

extends Object
implements GenericRecord
Class Inheritance
All Implemented Interfaces
org.apache.poi.common.usermodel.GenericRecord
Known Direct Subclasses
org.apache.poi.poifs.crypt.agile.AgileEncryptor, org.apache.poi.poifs.crypt.binaryrc4.BinaryRC4Encryptor, org.apache.poi.poifs.crypt.cryptoapi.CryptoAPIEncryptor, org.apache.poi.poifs.crypt.standard.StandardEncryptor, org.apache.poi.poifs.crypt.xor.XOREncryptor
Imports
java.io.IOException, .OutputStream, java.security.GeneralSecurityException, java.util.Map, java.util.function.Supplier, javax.crypto.SecretKey, org.apache.poi.EncryptedDocumentException, org.apache.poi.common.usermodel.GenericRecord, org.apache.poi.poifs.filesystem.DirectoryNode, .POIFSFileSystem, org.apache.poi.util.GenericRecordUtil

Field Summary

Modifier and TypeField and Description
protected static final String
private EncryptionInfo
private SecretKey

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public abstract void
confirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt)

public abstract void
public abstract Encryptor
copy()

public abstract OutputStream

Returns:

encrypted stream
getDataStream
(DirectoryNode
the node to write to
dir
)

Return an output stream for encrypted data.

public OutputStream
public ChunkedCipherOutputStream
getDataStream(OutputStream stream, int initialOffset)

public EncryptionInfo
public Map<String, Supplier<?>>
public static Encryptor
public SecretKey
public void
setChunkSize(int
the chunk size, i.e. the block size with the same encryption key
chunkSize
)

Sets the chunk size of the data stream.

public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_POIFS_ENTRYback to summary
protected static final String DEFAULT_POIFS_ENTRY
encryptionInfoback to summary
private EncryptionInfo encryptionInfo
secretKeyback to summary
private SecretKey secretKey

Constructor Detail

Encryptorback to summary
protected Encryptor()
Encryptorback to summary
protected Encryptor(Encryptor other)

Method Detail

confirmPasswordback to summary
public abstract void confirmPassword(String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt)
confirmPasswordback to summary
public abstract void confirmPassword(String password)
copyback to summary
public abstract Encryptor copy()
getDataStreamback to summary
public abstract OutputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException

Return an output stream for encrypted data.

Parameters
dir:DirectoryNode

the node to write to

Returns:OutputStream

encrypted stream

getDataStreamback to summary
public OutputStream getDataStream(POIFSFileSystem fs) throws IOException, GeneralSecurityException
getDataStreamback to summary
public ChunkedCipherOutputStream getDataStream(OutputStream stream, int initialOffset) throws IOException, GeneralSecurityException
getEncryptionInfoback to summary
public EncryptionInfo getEncryptionInfo()
getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getInstanceback to summary
public static Encryptor getInstance(EncryptionInfo info)
getSecretKeyback to summary
public SecretKey getSecretKey()
setChunkSizeback to summary
public void setChunkSize(int chunkSize)

Sets the chunk size of the data stream. Needs to be set before the data stream is requested. When not set, the implementation uses method specific default values

Parameters
chunkSize:int

the chunk size, i.e. the block size with the same encryption key

setEncryptionInfoback to summary
public void setEncryptionInfo(EncryptionInfo encryptionInfo)
setSecretKeyback to summary
public void setSecretKey(SecretKey secretKey)