Package org.nuxeo.ecm.core.blob
Class AESBlobStore.EncryptingOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.nuxeo.ecm.core.blob.AESBlobStore.EncryptingOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
- Enclosing class:
- AESBlobStore
public static class AESBlobStore.EncryptingOutputStream extends FilterOutputStream
Output stream that encrypts while writing.Stream format version 1 (values are in network order):
- 10 bytes: magic number "NUXEOCRYPT"
- 1 byte: file format version = 1
- 1 byte: use keystore = 1, use PBKDF2 = 2
- if use PBKDF2:
- 4 bytes: salt length = n
- n bytes: salt data
- 4 bytes: IV length = p
- p bytes: IV data
- x bytes: encrypted stream
- See Also:
AESBlobStore.DecryptingInputStream
-
-
Field Summary
Fields Modifier and Type Field Description protected AESBlobStoreConfiguration
aesConfig
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description EncryptingOutputStream(OutputStream out, AESBlobStoreConfiguration aesConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
write(byte[] b, int off, int len)
protected void
writeHeader()
-
Methods inherited from class java.io.FilterOutputStream
close, flush, write, write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Field Detail
-
aesConfig
protected final AESBlobStoreConfiguration aesConfig
-
-
Constructor Detail
-
EncryptingOutputStream
public EncryptingOutputStream(OutputStream out, AESBlobStoreConfiguration aesConfig) throws IOException
- Throws:
IOException
-
-
Method Detail
-
writeHeader
protected void writeHeader() throws IOException
- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOException
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
-