Class CryptoProcessor
java.lang.Object
com.sun.xml.ws.security.opt.impl.enc.CryptoProcessor
- Direct Known Subclasses:
DataEncryptionProcessor,KeyEncryptionProcessor
- Author:
- K.Venugopal@sun.com, Abhijit.Das@Sun.COM
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCryptoProcessor(int mode, String algo, Key key) CryptoProcessor(int mode, String algo, Key dk, Key key) CryptoProcessor(int mode, String algo, Data ed, Key key) Creates a new instance of EncryptionProcessor -
Method Summary
Modifier and TypeMethodDescriptionprotected StringconvertAlgURIToTransformation(String algorithmURI) Convert algorithm URI to actual transformation (DES/CBC/PKCS5Padding)byte[]decryptData(byte[] encryptedContent) decrypts the encryptedContent which a byte[]decrypts the given data which is of the form InputStreamdecryptKey(byte[] encryptedKey, String encAlgo) decrypts the encrypted key which is a byte[] with encAlgo algorithmvoidencrypt(OutputStream outputStream) encrypts outputStreambyte[]encryptData(byte[] cipherInput) initialises the Cipher and encrypts the data which is a byte[] and returns the encrypted datavoidencryptData(OutputStream eos) initialises the Cipher and encrypts the data which is a OutputStream and writes the encrypted data into the data membervoidencryptKey(OutputStream outputStream) wraps the data encryption key to byte[] and writes it to output streamprotected Stringbyte[]wraps the data encryption key .protected KeygetKey()protected voidcreates an instance of javax.crypto.Cipher class and inits it .voidsetEncryptedDataCV(byte[] cv)
-
Field Details
-
cipher
-
key
-
data
-
-
Constructor Details
-
CryptoProcessor
public CryptoProcessor() -
CryptoProcessor
Creates a new instance of EncryptionProcessor -
CryptoProcessor
-
CryptoProcessor
-
-
Method Details
-
initCipher
protected void initCipher() throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyExceptioncreates an instance of javax.crypto.Cipher class and inits it . -
getAlgorithm
-
convertAlgURIToTransformation
Convert algorithm URI to actual transformation (DES/CBC/PKCS5Padding)- Returns:
- String representing transforms
-
getKey
-
encrypt
encrypts outputStream- Throws:
IOException
-
getCipherValueOfEK
public byte[] getCipherValueOfEK()wraps the data encryption key .- Returns:
- ed byte[]
-
encryptKey
wraps the data encryption key to byte[] and writes it to output stream- Parameters:
outputStream- OutputStream- Throws:
IOException
-
setEncryptedDataCV
public void setEncryptedDataCV(byte[] cv) -
encryptData
public byte[] encryptData(byte[] cipherInput) initialises the Cipher and encrypts the data which is a byte[] and returns the encrypted data- Parameters:
cipherInput- byte[]- Returns:
- encryptedBytes byte[]
-
encryptData
initialises the Cipher and encrypts the data which is a OutputStream and writes the encrypted data into the data member- Parameters:
eos- OutputStream- Throws:
IOException
-
decryptKey
decrypts the encrypted key which is a byte[] with encAlgo algorithm- Parameters:
encryptedKey- byte[]encAlgo- String- Returns:
- Key
- Throws:
IOException
-
decryptData
decrypts the given data which is of the form InputStream- Parameters:
is- InputStream- Returns:
- InputStream
- Throws:
IOException
-
decryptData
decrypts the encryptedContent which a byte[]- Parameters:
encryptedContent- byte[]- Returns:
- byte[]
- Throws:
IOException
-