public class KdbxHeader extends Object
It is a factory for encryption and decryption streams and contains a hash of its own serialization.
While KDBX streams are Little-Endian, data is passed to and from this class in standard Java byte order.
| Modifier and Type | Class and Description |
|---|---|
static class |
KdbxHeader.CompressionFlags
The ordinal 0 represents uncompressed and 1 GZip compressed
|
static class |
KdbxHeader.ProtectedStreamAlgorithm
The ordinals represent various types of encryption that may
be applied to fields within the unencrypted data
|
| Modifier and Type | Field and Description |
|---|---|
static UUID |
AES_CIPHER
This UUID denotes that AES Cipher is in use.
|
| Constructor and Description |
|---|
KdbxHeader()
Construct a default KDBX header
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
createDecryptedStream(byte[] digest,
InputStream inputStream)
Create a decrypted input stream using supplied digest and this header
apply decryption to the passed encrypted input stream
|
OutputStream |
createEncryptedStream(byte[] digest,
OutputStream outputStream)
Create an unencrypted outputstream using the supplied digest and this header
and use the supplied output stream to write encrypted data.
|
UUID |
getCipherUuid() |
KdbxHeader.CompressionFlags |
getCompressionFlags() |
byte[] |
getEncryptionIv() |
byte[] |
getHeaderHash() |
byte[] |
getMasterSeed() |
KdbxHeader.ProtectedStreamAlgorithm |
getProtectedStreamAlgorithm() |
byte[] |
getProtectedStreamKey() |
byte[] |
getStreamStartBytes() |
long |
getTransformRounds() |
byte[] |
getTransformSeed() |
void |
setCipherUuid(byte[] uuid) |
void |
setCompressionFlags(int flags) |
void |
setEncryptionIv(byte[] encryptionIv) |
void |
setHeaderHash(byte[] headerHash) |
void |
setInnerRandomStreamId(int innerRandomStreamId) |
void |
setMasterSeed(byte[] masterSeed) |
void |
setProtectedStreamKey(byte[] protectedStreamKey) |
void |
setStreamStartBytes(byte[] streamStartBytes) |
void |
setTransformRounds(long transformRounds) |
void |
setTransformSeed(byte[] transformSeed) |
public static final UUID AES_CIPHER
public InputStream createDecryptedStream(byte[] digest, InputStream inputStream) throws IOException
digest - the key digestinputStream - the encrypted input streamIOException - if something bad happenspublic OutputStream createEncryptedStream(byte[] digest, OutputStream outputStream) throws IOException
digest - the key digestoutputStream - the output stream which is the destination for encrypted dataIOException - if something bad happenspublic UUID getCipherUuid()
public KdbxHeader.CompressionFlags getCompressionFlags()
public byte[] getMasterSeed()
public byte[] getTransformSeed()
public long getTransformRounds()
public byte[] getEncryptionIv()
public byte[] getProtectedStreamKey()
public byte[] getStreamStartBytes()
public KdbxHeader.ProtectedStreamAlgorithm getProtectedStreamAlgorithm()
public byte[] getHeaderHash()
public void setCipherUuid(byte[] uuid)
public void setCompressionFlags(int flags)
public void setMasterSeed(byte[] masterSeed)
public void setTransformSeed(byte[] transformSeed)
public void setTransformRounds(long transformRounds)
public void setEncryptionIv(byte[] encryptionIv)
public void setProtectedStreamKey(byte[] protectedStreamKey)
public void setStreamStartBytes(byte[] streamStartBytes)
public void setInnerRandomStreamId(int innerRandomStreamId)
public void setHeaderHash(byte[] headerHash)
Copyright © 2017. All rights reserved.