public class DESCipherImpl extends java.lang.Object implements URIConverter.Cipher
EMF implementation for the URIConverter.Cipher interface using
the DES encryption algorithm.
This shows how this class can be used:
Map options = new HashMap();
options.put(Resource.OPTION_CIPHER,
new DESCipherImpl("a very long key indeed"));
resource.save(options);
resource.load(options);
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
ENCRYPTION_SCHEME |
protected javax.crypto.SecretKey |
key |
protected java.lang.String |
stringKey |
protected static java.lang.String |
UNICODE_FORMAT |
| Constructor and Description |
|---|
DESCipherImpl() |
DESCipherImpl(java.lang.String key) |
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
decrypt(java.io.InputStream inputStream)
Decrypts the specified input stream.
|
java.io.OutputStream |
encrypt(java.io.OutputStream outputStream)
Encrypts the specified output stream.
|
void |
finish(java.io.InputStream inputStream)
This method is invoked after the decrypted input stream is used
allowing the Cipher implementation to do any maintenance work required,
such as flushing internal cache.
|
void |
finish(java.io.OutputStream outputStream)
This method is invoked after the encrypted output stream is used
allowing the Cipher implementation to do any maintenance work required,
such as flushing an internal cache.
|
protected javax.crypto.SecretKey |
getKey() |
protected static final java.lang.String ENCRYPTION_SCHEME
protected static final java.lang.String UNICODE_FORMAT
protected java.lang.String stringKey
protected javax.crypto.SecretKey key
public DESCipherImpl()
public DESCipherImpl(java.lang.String key)
public java.io.OutputStream encrypt(java.io.OutputStream outputStream)
throws java.lang.Exception
URIConverter.Cipherencrypt in interface URIConverter.Cipherjava.lang.Exceptionpublic void finish(java.io.OutputStream outputStream)
throws java.lang.Exception
URIConverter.Cipherfinish in interface URIConverter.CipheroutputStream - the encrypted stream returned by URIConverter.Cipher.encrypt(OutputStream).java.lang.Exceptionpublic java.io.InputStream decrypt(java.io.InputStream inputStream)
throws java.lang.Exception
URIConverter.Cipherdecrypt in interface URIConverter.Cipherjava.lang.Exceptionpublic void finish(java.io.InputStream inputStream)
throws java.lang.Exception
URIConverter.Cipherfinish in interface URIConverter.CipherinputStream - the stream returned by URIConverter.Cipher.decrypt(InputStream).java.lang.Exceptionprotected javax.crypto.SecretKey getKey()
throws java.lang.Exception
java.lang.Exception