Package com.seclore.fs.helper.crypto
Class DefaultCryptoHandler
java.lang.Object
com.seclore.fs.helper.crypto.DefaultCryptoHandler
- All Implemented Interfaces:
com.seclore.fs.ws.client.pscp.CryptoHandler
public class DefaultCryptoHandler
extends Object
implements com.seclore.fs.ws.client.pscp.CryptoHandler
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultCryptoHandler(String pKeyXML, int pKeyLength, String pKeyID, String pChainingMode, String pPadding) Creates the object of CryptoHandler. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]decryptWithPrivateKey(byte[] pCipherData) This method decrypts data using private keybyte[]encryptWithPrivateKey(byte[] pPlainData) This method encrypts data using private keygetKeyID()Gets the Key ID for the implemented Handler
-
Constructor Details
-
DefaultCryptoHandler
public DefaultCryptoHandler(String pKeyXML, int pKeyLength, String pKeyID, String pChainingMode, String pPadding) throws FSHelperException Creates the object of CryptoHandler. This is the default implementation for the Crypto Handler. This implementation supports RSA based Encryption, with PKCS1Padding, as a ECB chaining Mode- Parameters:
pKeyXML- Private key in xml. The components should be in hexadecimal format.pKeyLength- Length of the private Key. Example - 256pKeyID- A unique Id which is mapped to the public key part on Policy Server.pChainingMode- Chaining mode to be used for encrypt or decrypt. Example - ECBpPadding- Padding to be used for encrypt or decrypt. Example - PKCS1Padding- Throws:
FSHelperException- if values is not valid.
-
-
Method Details
-
encryptWithPrivateKey
public byte[] encryptWithPrivateKey(byte[] pPlainData) throws com.seclore.fs.ws.client.exception.WSClientException Description copied from interface:com.seclore.fs.ws.client.pscp.CryptoHandlerThis method encrypts data using private key- Specified by:
encryptWithPrivateKeyin interfacecom.seclore.fs.ws.client.pscp.CryptoHandler- Returns:
- encrypted data
- Throws:
com.seclore.fs.ws.client.exception.WSClientException
-
decryptWithPrivateKey
public byte[] decryptWithPrivateKey(byte[] pCipherData) throws com.seclore.fs.ws.client.exception.WSClientException Description copied from interface:com.seclore.fs.ws.client.pscp.CryptoHandlerThis method decrypts data using private key- Specified by:
decryptWithPrivateKeyin interfacecom.seclore.fs.ws.client.pscp.CryptoHandler- Parameters:
pCipherData- - The data byte array to be decrypted- Returns:
- decrypted data
- Throws:
com.seclore.fs.ws.client.exception.WSClientException
-
getKeyID
Description copied from interface:com.seclore.fs.ws.client.pscp.CryptoHandlerGets the Key ID for the implemented Handler- Specified by:
getKeyIDin interfacecom.seclore.fs.ws.client.pscp.CryptoHandler- Returns:
- key id
-