com.plumtree.openfoundation.security
Interface IXPCrypto

All Known Implementing Classes:
XPAESCrypto, XPRC2Crypto

public interface IXPCrypto

Interface defining a class which can be used to encrypt or decrypt data as strings. The class uses private key encryption, therefore the key is the same for both encryption and decryption. See IXPPKICrypto for public key encryption.


Method Summary
 boolean CanDecrypt(java.lang.String toDecrypt)
          Can this provider decrypt this string?
 java.lang.String Decrypt(java.lang.String toDecrypt, byte[] key)
          Decrypts data which was encrypted using Encrypt.
 java.lang.String Decrypt(java.lang.String toDecrypt, java.lang.String password)
          Decrypts data which was encrypted using Encrypt.
 java.lang.String Encrypt(java.lang.String toEncrypt, byte[] key)
          Encrypts data.
 java.lang.String Encrypt(java.lang.String toEncrypt, java.lang.String password)
          Encrypts data.
 byte[] GenerateKey()
          Generates a new random key.
 

Method Detail

Decrypt

java.lang.String Decrypt(java.lang.String toDecrypt,
                         java.lang.String password)
Decrypts data which was encrypted using Encrypt.

Parameters:
toDecrypt - the data to decrypt
password - a key generated from this password will be used to decrypt the data
Returns:
the decrypted data

Encrypt

java.lang.String Encrypt(java.lang.String toEncrypt,
                         java.lang.String password)
Encrypts data. Use Decrypt to decrypt the data.

Parameters:
toEncrypt - the data to encrypt
password - a key generated from this password will be used to decrypt the data
Returns:
the encrypted data

Decrypt

java.lang.String Decrypt(java.lang.String toDecrypt,
                         byte[] key)
Decrypts data which was encrypted using Encrypt.

Parameters:
toDecrypt - the data to decrypt
key - the key to use to decrypt the data
Returns:
the decrypted data

Encrypt

java.lang.String Encrypt(java.lang.String toEncrypt,
                         byte[] key)
Encrypts data. Use Decrypt to decrypt the data.

Parameters:
toEncrypt - the data to encrypt
key - the key to use to encrypt the data
Returns:
the encrypted data

GenerateKey

byte[] GenerateKey()
Generates a new random key.

Returns:
the key

CanDecrypt

boolean CanDecrypt(java.lang.String toDecrypt)
Can this provider decrypt this string?

Parameters:
toDecrypt - an encrypted string
Returns:
true if this provider can decrypt the string


Copyright 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.