public class KeePassHeader extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CIPHER |
static int |
COMPRESSION |
static int |
ENCRYPTION_IV |
static int |
INNER_RANDOM_STREAM_ID |
static int |
MASTER_SEED |
static int |
PROTECTED_STREAM_KEY |
static int |
STREAM_START_BYTES |
static int |
TRANSFORM_ROUNDS |
static int |
TRANSFORM_SEED |
static int |
VERSION_SIGNATURE_LENGTH |
| Constructor and Description |
|---|
KeePassHeader() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkVersionSupport(byte[] keepassFile) |
byte[] |
getBytes()
Returns the whole header as byte array.
|
byte[] |
getCipher() |
CompressionAlgorithm |
getCompression() |
CrsAlgorithm |
getCrsAlgorithm() |
byte[] |
getEncryptionIV() |
int |
getHeaderSize() |
byte[] |
getMasterSeed() |
byte[] |
getProtectedStreamKey() |
byte[] |
getStreamStartBytes() |
long |
getTransformRounds() |
byte[] |
getTransformSeed() |
byte[] |
getValue(int headerId) |
void |
initialize()
Initializes the header with default values and creates new random values for crypto keys.
|
void |
read(byte[] keepassFile)
Initializes the header values from a given byte array.
|
void |
setCompression(CompressionAlgorithm algorithm) |
void |
setCrsAlgorithm(CrsAlgorithm algorithm) |
void |
setTransformRounds(long rounds) |
void |
setValue(int headerId,
byte[] value) |
public static final int CIPHER
public static final int COMPRESSION
public static final int MASTER_SEED
public static final int TRANSFORM_SEED
public static final int TRANSFORM_ROUNDS
public static final int ENCRYPTION_IV
public static final int PROTECTED_STREAM_KEY
public static final int STREAM_START_BYTES
public static final int INNER_RANDOM_STREAM_ID
public static final int VERSION_SIGNATURE_LENGTH
public void setValue(int headerId,
byte[] value)
public void checkVersionSupport(byte[] keepassFile)
throws IOException
IOExceptionpublic void read(byte[] keepassFile)
throws IOException
keepassFile - the byte array to read fromIOException - if the header cannot be readpublic byte[] getBytes()
public byte[] getValue(int headerId)
public void setCompression(CompressionAlgorithm algorithm)
public byte[] getCipher()
public CompressionAlgorithm getCompression()
public long getTransformRounds()
public void setTransformRounds(long rounds)
public byte[] getEncryptionIV()
public byte[] getStreamStartBytes()
public CrsAlgorithm getCrsAlgorithm()
public void setCrsAlgorithm(CrsAlgorithm algorithm)
public byte[] getMasterSeed()
public byte[] getTransformSeed()
public int getHeaderSize()
public byte[] getProtectedStreamKey()
public void initialize()
Default values:
Copyright © 2016. All rights reserved.