com.pega.pegarules.pub.crypto
Interface IPRCrypto


public interface IPRCrypto


Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Method Summary
 java.lang.String decrypt(java.lang.String aInput)
          Decrypts the specified string.
 java.lang.String decrypt(java.lang.String aInput, int[] aType)
          Alternate decryption entry for use during initialization of PegaRULES.
 java.lang.String decryptPropertyValue(java.lang.String aInput)
          Decrypts the specified property value using a site specific cipher.
 java.lang.String encrypt(java.lang.String aInput)
          Encrypts the specified string using the site-specific reversible encryption cipher if it exists, otherwise the PegaRULES default portable and reversible encryption cipher.
 java.lang.String encryptOneWay(java.lang.String aInput)
          One-way encrypts the specified string.
 java.lang.String encryptPortable(java.lang.String aInput)
          Encrypts the specified string using PegaRULES default portable and reversible encryption cipher.
 java.lang.String encryptPropertyValue(java.lang.String aInput)
          Encrypts the specified property value using a site specific cipher.
 IPRCipher getCipher(java.lang.String aAlgorithm, byte[] aKey, int aKeylen, byte[] aParams)
          Constructs an IPRCipher implementation with the specified parameters.
 IPRCipher getCipher(java.lang.String aProvider, java.lang.String aAlgorithm, byte[] aKey, int aKeylen, byte[] aParams)
          Constructs an IPRCipher implementation with the specified parameters.
 IPRCipher getPortableCipher()
          returns the PegaRULES default portable cipher implementation.
 IPRCipher getSiteCipher()
          returns the site-specific cipher implementation.
 boolean samePassword(java.lang.String pw1, java.lang.String pw2)
          Returns true if the two passwords represent the same cleartext value.
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

static final java.lang.String VERSION
See Also:
Constant Field Values
Method Detail

getPortableCipher

IPRCipher getPortableCipher()
returns the PegaRULES default portable cipher implementation.

Returns:
IPRCipher instance

getSiteCipher

IPRCipher getSiteCipher()
returns the site-specific cipher implementation.

Returns:
IPRCipher instance or null

getCipher

IPRCipher getCipher(java.lang.String aAlgorithm,
                    byte[] aKey,
                    int aKeylen,
                    byte[] aParams)
Constructs an IPRCipher implementation with the specified parameters.

Parameters:
aAlgorithm - Algorithm or transform to be used (e.g. desede or des/none/pkcs5padding)
aKey - algorithm specific key or null to use a generated key
aKeylen - length of key to be used
aParams - initialization vector (for padding)
Returns:
IPRCipher instance

getCipher

IPRCipher getCipher(java.lang.String aProvider,
                    java.lang.String aAlgorithm,
                    byte[] aKey,
                    int aKeylen,
                    byte[] aParams)
Constructs an IPRCipher implementation with the specified parameters.

Parameters:
aProvider - specific provider name to use or null if a JDK default provider should be used
aAlgorithm - Algorithm or transform to be used (e.g. desede or des/none/pkcs5padding)
aKey - algorithm specific key or null to use a generated key
aKeylen - length of key to be used
aParams - initialization vector (for padding)
Returns:
IPRCipher instance

encryptOneWay

java.lang.String encryptOneWay(java.lang.String aInput)
One-way encrypts the specified string.

Parameters:
aInput - cleartext string to encrypt
Returns:
resulting value

encryptPortable

java.lang.String encryptPortable(java.lang.String aInput)
Encrypts the specified string using PegaRULES default portable and reversible encryption cipher.

Parameters:
aInput - cleartext string to encrypt
Returns:
resulting value

encrypt

java.lang.String encrypt(java.lang.String aInput)
Encrypts the specified string using the site-specific reversible encryption cipher if it exists, otherwise the PegaRULES default portable and reversible encryption cipher.

Parameters:
aInput - cleartext string to encrypt
Returns:
resulting value

encryptPropertyValue

java.lang.String encryptPropertyValue(java.lang.String aInput)
Encrypts the specified property value using a site specific cipher. If it does not exist a CryptographicException is thrown.

Parameters:
aInput - cleartext string to encrypt
Returns:
resulting value

decryptPropertyValue

java.lang.String decryptPropertyValue(java.lang.String aInput)
Decrypts the specified property value using a site specific cipher. If it does not exist a CryptographicException is thrown.

Parameters:
aInput - cleartext string to decrypt
Returns:
resulting value

decrypt

java.lang.String decrypt(java.lang.String aInput)
Decrypts the specified string.

If input is ONEWAY encrypted, the ONEWAY value (after being unwrapped from the V5 envelope, if necessary) is returned.

If input is SITE_SPECIFIC encrypted and no site-specific cipher is available, a CryptographicException is thrown.

If input uses an unrecognized cipher or is otherwise opaque to this routine (including a cleartext value), the input value is returned unchanged.

Parameters:
aInput - value to decrypt to cleartext
Returns:
resulting value

decrypt

java.lang.String decrypt(java.lang.String aInput,
                         int[] aType)
Alternate decryption entry for use during initialization of PegaRULES. Supplies int array to avoid use of factories at an early stage of initialization. See decrypt(String) for usage.

Parameters:
aInput - value to decrypt to cleartext
aType - int[2] array for internal use
Returns:
resulting value

samePassword

boolean samePassword(java.lang.String pw1,
                     java.lang.String pw2)
Returns true if the two passwords represent the same cleartext value. If both passwords are null, the result is true, otherwise they must match as defined herein.

If both passwords use the same encryption algorithm (including values treated as cleartext due to unrecognized format), the result of calling decrypt on both strings is compared.

If exactly one of the passwords is oneway encrypted, the other value's decrypt result is oneway encrypted and the (unwrapped) oneway values are compared.

Otherwise, the result of calling decrypt on both strings is compared, although the result is almost certainly false.

Parameters:
pw1 - first comparand
pw2 - second comparand
Returns:
result of comparision


Copyright © 2012 Pegasystems Inc. All Rights Reserved.