private class KeyManagerZipCryptoParameters.WinZipAes extends Object implements WinZipAesParameters
KeyProvider for AesPbeParameters obtained
from the KeyManagerZipCryptoParameters.keyManager(java.lang.Class<K>) to WinZipAesParameters.| Modifier and Type | Field and Description |
|---|---|
(package private) KeyManager<AesPbeParameters> |
manager |
| Modifier | Constructor and Description |
|---|---|
private |
KeyManagerZipCryptoParameters.WinZipAes() |
| Modifier and Type | Method and Description |
|---|---|
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,
AesKeyStrength keyStrength)
Sets the key strength obtained from reading a WinZip AES entry.
|
final KeyManager<AesPbeParameters> manager
private KeyManagerZipCryptoParameters.WinZipAes()
public AesKeyStrength getKeyStrength(String name) throws ZipKeyException
WinZipAesParametersgetKeyStrength in interface WinZipAesParametersname - the ZIP entry name.ZipKeyException - If key retrieval has failed for some reason.public byte[] getReadPassword(String name, boolean invalid) throws ZipKeyException
WinZipAesParametersWARNING: 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!
getReadPassword in interface WinZipAesParametersname - 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.WinZipAesParameters.getWritePassword(String)public byte[] getWritePassword(String name) throws ZipKeyException
WinZipAesParametersWARNING: 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.
getWritePassword in interface WinZipAesParametersname - the ZIP entry name.ZipKeyException - If key retrieval has failed for some reason.public void setKeyStrength(String name, AesKeyStrength keyStrength) throws ZipKeyException
WinZipAesParameterssetKeyStrength in interface WinZipAesParametersname - 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 © 2004-2011 Schlichtherle IT Services. All Rights Reserved.