public interface WinZipAesParameters extends ZipCryptoParameters
Modifier and Type | Method and Description |
---|---|
net.java.truecommons.key.spec.common.AesKeyStrength |
getKeyStrength(String name)
Returns the key strength to use for writing a WinZip AES entry.
|
byte[] |
getReadPassword(String name,
boolean invalid)
Returns the password bytes to use for reading a WinZip AES entry.
|
byte[] |
getWritePassword(String name)
Returns the password bytes to use for writing a WinZip AES entry.
|
void |
setKeyStrength(String name,
net.java.truecommons.key.spec.common.AesKeyStrength keyStrength)
Sets the key strength obtained from reading a WinZip AES entry.
|
net.java.truecommons.key.spec.common.AesKeyStrength getKeyStrength(String name) throws ZipKeyException
name
- the ZIP entry name.ZipKeyException
- If key retrieval has failed for some reason.byte[] getReadPassword(String name, boolean invalid) throws ZipKeyException
WARNING: Unfortunately, the document AES Encryption Information: Encryption Specification AE-1 and AE-2 does not specify how password strings should get encoded to bytes. This means that whatever encoding you chose in the implementation, chances are that you will not be able to read WinZip AES entries a third party has written. This could even be your past self when you were using another application or platform at the time!
name
- the ZIP entry name.invalid
- true
iff a previous call to this method returned
an invalid password.ZipKeyException
- If key retrieval has failed for some reason.getWritePassword(String)
byte[] getWritePassword(String name) throws ZipKeyException
WARNING: Unfortunately, the document AES Encryption Information: Encryption Specification AE-1 and AE-2 does not specify how password strings should get encoded to bytes. This means that whatever encoding you chose in the implementation, chances are that an authorized third party will not be able to read WinZip AES entries you have written. This could even be your future self when you are using another application or platform then!
There are several reasonable schemes you could chose to encode password characters to bytes:
A reasonable alternative implementation could encode the given char array using the same character set which is used to encode entry names and comments, e.g. UTF-8 or CP437.
name
- the ZIP entry name.ZipKeyException
- If key retrieval has failed for some reason.void setKeyStrength(String name, net.java.truecommons.key.spec.common.AesKeyStrength keyStrength) throws ZipKeyException
name
- the ZIP entry name.keyStrength
- the key strength obtained from reading a WinZip AES
entry.ZipKeyException
- If key retrieval has failed for some reason.Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.