|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.fulcrum.pbe.PBEServiceImpl
public class PBEServiceImpl
Encapsulates an PBE (Password Based Encryption) functionality from the JCE (Java Crypto Extension).
Constructor Summary | |
---|---|
PBEServiceImpl()
Constructor |
Method Summary | |
---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
char[] |
createPassword()
Create a password based on the pre-defined seed. |
char[] |
createPassword(char[] seed)
Create a password based on the supplied seed. |
void |
decrypt(Object source,
Object target,
char[] password)
Copies from a source to a target object using decrpytion. |
String |
decryptString(String cipherText,
char[] password)
Decrypts an encrypted string into the plain text. |
void |
encrypt(Object source,
Object target,
char[] password)
Copies from a source to a target object using encryption. |
String |
encryptString(String plainText,
char[] password)
Encrypts a string into a hex string. |
InputStream |
getInputStream(InputStream is,
char[] password)
Creates a decrypting input stream. |
OutputStream |
getOutputStream(OutputStream os,
char[] password)
Creates an encrypting output stream. |
InputStream |
getSmartInputStream(InputStream is,
char[] password)
Creates a smart decrypting input stream. |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PBEServiceImpl()
Method Detail |
---|
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
org.apache.avalon.framework.configuration.ConfigurationException
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)
public char[] createPassword() throws Exception
PBEService
createPassword
in interface PBEService
Exception
- the password creation failedPBEService.createPassword()
public char[] createPassword(char[] seed) throws Exception
PBEService
createPassword
in interface PBEService
seed
- the seed value for the password generation
Exception
- the password creation failedPBEService.createPassword(char[])
public String decryptString(String cipherText, char[] password) throws GeneralSecurityException, IOException
PBEService
decryptString
in interface PBEService
cipherText
- the encrypted text to be decryptedpassword
- the password for decryption
GeneralSecurityException
- accessing the JCE failed
IOException
- an IOException occured during processingPBEService.decryptString(java.lang.String, char[])
public String encryptString(String plainText, char[] password) throws GeneralSecurityException, IOException
PBEService
encryptString
in interface PBEService
plainText
- the plain text to be encryptedpassword
- the password for encryption
GeneralSecurityException
- accessing the JCE failed
IOException
- an IOException occured during processingPBEService.encryptString(java.lang.String, char[])
public InputStream getInputStream(InputStream is, char[] password) throws GeneralSecurityException, IOException
PBEService
getInputStream
in interface PBEService
is
- the input stream to be wrappedpassword
- the password to be used
GeneralSecurityException
- accessing the JCE failed
IOException
- an IOException occured during processingPBEService.getInputStream(java.io.InputStream, char[])
public InputStream getSmartInputStream(InputStream is, char[] password) throws GeneralSecurityException, IOException
PBEService
getSmartInputStream
in interface PBEService
is
- the input stream to be wrappedpassword
- the password to be used
GeneralSecurityException
- accessing the JCE failed
IOException
- an IOException occured during processingPBEService.getSmartInputStream(java.io.InputStream, char[])
public OutputStream getOutputStream(OutputStream os, char[] password) throws GeneralSecurityException, IOException
PBEService
getOutputStream
in interface PBEService
os
- the output stream to be wrappedpassword
- the password to be used
GeneralSecurityException
- accessing the JCE failed
IOException
- an IOException occured during processingPBEService.getOutputStream(java.io.OutputStream, char[])
public void decrypt(Object source, Object target, char[] password) throws GeneralSecurityException, IOException
PBEService
decrypt
in interface PBEService
source
- the source objecttarget
- the target objectpassword
- the password to use for decryption
GeneralSecurityException
- accessing the JCE failed
IOException
- an IOException occured during processingPBEService.decrypt(java.lang.Object, java.lang.Object, char[])
public void encrypt(Object source, Object target, char[] password) throws GeneralSecurityException, IOException
PBEService
encrypt
in interface PBEService
source
- the source objecttarget
- the target objectpassword
- the password to use for encryption
GeneralSecurityException
- accessing the JCE failed
IOException
- an IOException occured during processingPBEService.encrypt(java.lang.Object, java.lang.Object, char[])
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |