Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.0

E18767-01


com.bea.wcp.sip.security.utils
Class JSafeEncryptionUtil

java.lang.Object
  extended by com.bea.wcp.sip.security.utils.JSafeEncryptionUtil


public final class JSafeEncryptionUtil
extends java.lang.Object

Class to encrypt and decrypt the customer data used for external systems. Key requirement for this data is that reversible encryption be necessary - i.e. someone must present this data in clear form someplace. This class can be used on command line. Please see the usage for details.


Constructor Summary
JSafeEncryptionUtil(byte[] key, byte[] initVector, java.lang.String algorithm)
          Package access constructor to be called by the EncryptionServiceFactory instance associated with this service

 

Method Summary
 byte[] decryptBytes(byte[] data)
          Decrypt this byte array.
 java.lang.String decryptString(byte[] encryptedString)
          decrypts the byte array into clear text string
 byte[] encryptBytes(byte[] data)
          Encrypt this byte array.
 byte[] encryptString(java.lang.String clearText)
          Encrypts a string in clear text
static void main(java.lang.String[] args)
          The main method.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

JSafeEncryptionUtil

public JSafeEncryptionUtil(byte[] key,
                           byte[] initVector,
                           java.lang.String algorithm)
                    throws weblogic.security.internal.encryption.EncryptionServiceException
Package access constructor to be called by the EncryptionServiceFactory instance associated with this service
Parameters:
key -
initVector -
algorithm -
Throws:
weblogic.security.internal.encryption.EncryptionServiceException

Method Detail

encryptBytes

public byte[] encryptBytes(byte[] data)
                    throws weblogic.security.internal.encryption.EncryptionServiceException
Encrypt this byte array.
Parameters:
data - input byte array
Returns:
encrypted bytes
Throws:
weblogic.security.internal.encryption.EncryptionServiceException

decryptBytes

public byte[] decryptBytes(byte[] data)
                    throws weblogic.security.internal.encryption.EncryptionServiceException
Decrypt this byte array.
Parameters:
data - input byte array
Returns:
encrypted bytes
Throws:
weblogic.security.internal.encryption.EncryptionServiceException

encryptString

public byte[] encryptString(java.lang.String clearText)
                     throws weblogic.security.internal.encryption.EncryptionServiceException
Encrypts a string in clear text
Parameters:
clearText - clear text string
Returns:
encrypted bytes
Throws:
weblogic.security.internal.encryption.EncryptionServiceException

decryptString

public java.lang.String decryptString(byte[] encryptedString)
                               throws weblogic.security.internal.encryption.EncryptionServiceException
decrypts the byte array into clear text string
Parameters:
encryptedString -
Returns:
clear text
Throws:
weblogic.security.internal.encryption.EncryptionServiceException

main

public static void main(java.lang.String[] args)
The main method.

Usages:

java com.bea.wcp.sip.security.utils.JSafeEncryptionUtil (print usage)

java com.bea.wcp.sip.security.utils.JSafeEncryptionUtil test (test the encryption and decryption)

java com.bea.wcp.sip.security.utils.JSafeEncryptionUtil exposedefaultkeyandinitvector (expose a default key and init vector as base64 encoded byte array.)

java com.bea.wcp.sip.security.utils.JSafeEncryptionUtil encryption stringvalue algorithm encrytionKey, initVector (encrypt the given string use default key and init vector)

java com.bea.wcp.sip.security.utils.JSafeEncryptionUtil decryption stringvalue algorithm encrytionKey, initVector (encrypt the given string use default key and init vector)


Skip navigation links

Oracle Communications Converged Application Server Java API Reference
5.0

E18767-01


Copyright © 2005, 2010, Oracle and/or its affiliates. All rights reserved.