public abstract class Encryptor
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DEFAULT_POIFS_ENTRY |
Constructor and Description |
---|
Encryptor() |
Modifier and Type | Method and Description |
---|---|
Encryptor |
clone() |
abstract void |
confirmPassword(java.lang.String password) |
abstract void |
confirmPassword(java.lang.String password,
byte[] keySpec,
byte[] keySalt,
byte[] verifier,
byte[] verifierSalt,
byte[] integritySalt) |
abstract java.io.OutputStream |
getDataStream(DirectoryNode dir)
Return a output stream for encrypted data.
|
ChunkedCipherOutputStream |
getDataStream(java.io.OutputStream stream,
int initialOffset) |
java.io.OutputStream |
getDataStream(POIFSFileSystem fs) |
EncryptionInfo |
getEncryptionInfo() |
static Encryptor |
getInstance(EncryptionInfo info) |
javax.crypto.SecretKey |
getSecretKey() |
void |
setChunkSize(int chunkSize)
Sets the chunk size of the data stream.
|
void |
setEncryptionInfo(EncryptionInfo encryptionInfo) |
void |
setSecretKey(javax.crypto.SecretKey secretKey) |
protected static final java.lang.String DEFAULT_POIFS_ENTRY
public abstract java.io.OutputStream getDataStream(DirectoryNode dir) throws java.io.IOException, java.security.GeneralSecurityException
dir
- the node to write tojava.io.IOException
java.security.GeneralSecurityException
public abstract void confirmPassword(java.lang.String password, byte[] keySpec, byte[] keySalt, byte[] verifier, byte[] verifierSalt, byte[] integritySalt)
public abstract void confirmPassword(java.lang.String password)
public static Encryptor getInstance(EncryptionInfo info)
public java.io.OutputStream getDataStream(POIFSFileSystem fs) throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
java.security.GeneralSecurityException
public ChunkedCipherOutputStream getDataStream(java.io.OutputStream stream, int initialOffset) throws java.io.IOException, java.security.GeneralSecurityException
java.io.IOException
java.security.GeneralSecurityException
public javax.crypto.SecretKey getSecretKey()
public void setSecretKey(javax.crypto.SecretKey secretKey)
public EncryptionInfo getEncryptionInfo()
public void setEncryptionInfo(EncryptionInfo encryptionInfo)
public void setChunkSize(int chunkSize)
chunkSize
- the chunk size, i.e. the block size with the same encryption keypublic Encryptor clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
Copyright 2018 The Apache Software Foundation or its licensors, as applicable.