public class DecryptionProviderImpl extends Object implements DecryptionProvider
DecryptionProvider
interface.
ATTENTION: This implementation does not take care of housekeeping. In case this class is to be run as a service, it must provide housekeeping facilities in terms of cleaning up instances contained in internal data structures (such as the hash maps) after a defined period of time those instance were not accessed.
Constructor and Description |
---|
DecryptionProviderImpl(DecryptionService aDecryptionService)
Constructs the
DecryptionProvider using AES as implemented by the
BouncyCastleProvider . |
DecryptionProviderImpl(DecryptionService aDecryptionService,
Provider aJceProvider,
String aJceAlgorithm)
Constructs the
DecryptionProvider with the given
DecryptionService and with the specified JCE Provider as
well as the according JCE algorithm. |
Modifier and Type | Method and Description |
---|---|
int |
toDecrypted(byte[] aInput,
int aInputOffset,
int aInputLength,
byte[] aOutput,
int aOutputOffset) |
String |
toDecrypted(String aInput)
Encrypts a text with the latest known valid cipher.
|
public DecryptionProviderImpl(DecryptionService aDecryptionService, Provider aJceProvider, String aJceAlgorithm)
DecryptionProvider
with the given
DecryptionService
and with the specified JCE Provider
as
well as the according JCE algorithm.aDecryptionService
- The DecryptionService
to use for
getting the known ciphers for decryptionaJceProvider
- The JCE Provider
to be used.aJceAlgorithm
- the JCE algorithm to be used by the JCE
Provider
.public DecryptionProviderImpl(DecryptionService aDecryptionService)
DecryptionProvider
using AES as implemented by the
BouncyCastleProvider
.aDecryptionService
- The service to use for getting the known
ciphers for decryptionpublic String toDecrypted(String aInput) throws UnknownCipherUidException, NoCipherUidException
DecryptionProvider
toDecrypted
in interface DecryptionProvider
toDecrypted
in interface org.refcodes.security.Decrypter<String,String,org.refcodes.security.DecryptionException>
aInput
- The text to be encryptedUnknownCipherUidException
- in case the cipher UID prefixed to the
encrypted text is unknownNoCipherUidException
- in case no cipher UID was found prefixed to
the provided text.public int toDecrypted(byte[] aInput, int aInputOffset, int aInputLength, byte[] aOutput, int aOutputOffset) throws ShortBufferException, org.refcodes.security.DecryptionException
toDecrypted
in interface org.refcodes.security.Decrypter<String,String,org.refcodes.security.DecryptionException>
ShortBufferException
org.refcodes.security.DecryptionException
Copyright © 2016. All rights reserved.