com.pega.pegarules.pub.crypto
Interface IPRCipher


public interface IPRCipher


Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String VERSION
           
 
Method Summary
 byte[] decrypt(byte[] aInput)
          Decrypts the supplied byte array using the cipher associated with this instance.
 byte[] encrypt(byte[] aInput)
          Encrypts the supplied byte array using the cipher associated with this instance.
 byte[] generateIV()
          Generates an initialization vector that may be used with this cipher.
 byte[] generateKey()
          Generates a key that may be used with this cipher.
 javax.crypto.CipherInputStream getInputStream(java.io.InputStream aInput)
          Supplies a CipherInputStream using the cipher associated with this instance.
 javax.crypto.CipherOutputStream getOutputStream(java.io.OutputStream aInput)
          Supplies a CipherOutputStream using the cipher associated with this instance.
 boolean needsIV()
          Set by constructor if the supplied parameters are insufficient in that an initialization vector is required.
 

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

encrypt

byte[] encrypt(byte[] aInput)
Encrypts the supplied byte array using the cipher associated with this instance.

Parameters:
aInput - byte array to be encrypted
Returns:
byte array resulting from encryption

decrypt

byte[] decrypt(byte[] aInput)
Decrypts the supplied byte array using the cipher associated with this instance.

Parameters:
aInput - byte array to be decrypted
Returns:
byte array resulting from decryption

getInputStream

javax.crypto.CipherInputStream getInputStream(java.io.InputStream aInput)
Supplies a CipherInputStream using the cipher associated with this instance.

Parameters:
aInput - InputStream to be wrapped with the cipher
Returns:
cipher stream

getOutputStream

javax.crypto.CipherOutputStream getOutputStream(java.io.OutputStream aInput)
Supplies a CipherOutputStream using the cipher associated with this instance.

Parameters:
aInput - OutputStream to be wrapped with the cipher
Returns:
cipher stream

needsIV

boolean needsIV()
Set by constructor if the supplied parameters are insufficient in that an initialization vector is required. In this case encryption can be performed, but the data cannot be decrypted because the randomly generated initialization vector cannot be retrieved.

If no initialization vector was provided in the constructor, check this value after obtaining a PRCipher instance. If true, call generateIV() and use that value into obtain a new PRCipher instance.

Returns:
true if an initialization vector is required by the algorithm and none was supplied to the constructor.

generateKey

byte[] generateKey()
Generates a key that may be used with this cipher.

Returns:
generated key

generateIV

byte[] generateIV()
Generates an initialization vector that may be used with this cipher.

Returns:
generated initialization vector


Copyright © 2012 Pegasystems Inc. All Rights Reserved.