org.polyglotted.crypto.asymmetric
Class RsaDecrypter
java.lang.Object
org.polyglotted.crypto.api.AbstractCrypto
org.polyglotted.crypto.asymmetric.RsaDecrypter
- All Implemented Interfaces:
- Crypto
public class RsaDecrypter
- extends AbstractCrypto
RsaDecrypter uses RSA algorithm of Asymmetric key cryptography to convert unreadable cipher text into plain text.
- Author:
- Shankar Vasudevan
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RsaDecrypter
public RsaDecrypter(PrivateKey key)
- Create a new RsaDecrypter
- Parameters:
key - the PrivateKey for the decryption
getMode
public AbstractCrypto.Mode getMode()
- Specified by:
getMode in class AbstractCrypto
- Returns:
- if this crypto performs an encrypt or decrypt operation
crypt
public String crypt(String text)
- Description copied from interface:
Crypto
- Perform encrypt or decrypt action
- Parameters:
text - the String to crypt
- Returns:
- the result String
decrypt
public static String decrypt(InputStream privKeyIs,
String cipherText)
- Decrypt the given text with a private key
- Parameters:
privKeyIs - the private key input streaminput - the cipher data to be decryted
- Returns:
- the String containing plain text
decryptFile
public static void decryptFile(InputStream privKeyIs,
InputStream input,
OutputStream output)
- Decrypt the incoming file and copy the resulting data into the output stream.
- Parameters:
privKeyIs - the private key input streaminput - the file input streamoutput - the output stream to write the decrypted values
decryptPropertyFile
public static void decryptPropertyFile(InputStream privKeyIs,
InputStream propertyIs,
OutputStream output,
String prefix)
- Decrypt the incoming property file and copy the resulting data into the output stream.
- Parameters:
privKeyIs - the private key input streampropertyIs - the property file input streamoutput - the output stream to write the decrypted valuesprefix - the String prefix for lines which have to be decryted
Copyright © 2012-2013 Polyglotted Org. All Rights Reserved.