com.wewebu.ow.server.util
Class OwSecretKey

java.lang.Object
  extended by com.wewebu.ow.server.util.OwSecretKey

public class OwSecretKey
extends Object

Represents a static secret key used for encryption.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Constructor Summary
OwSecretKey()
          create a key out of the given serialized byte representation
 
Method Summary
static String createJavaCodeKeyDeclaration(String algorithm_p)
          dump a java code byte array representation of a secret key
static byte[] createSerializedKey(String algorithm_p)
          create a secret key and return it as a serialized byte array
static String getAlgorithm()
          get the used algorithm
 Cipher getCipher()
          get a cipher for the key
 Key getKey()
          get the key
static void main(String[] args_p)
          create a new java m_keybytes member
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwSecretKey

public OwSecretKey()
create a key out of the given serialized byte representation

Method Detail

getKey

public Key getKey()
get the key

Returns:
a Key

getCipher

public Cipher getCipher()
                 throws NoSuchAlgorithmException,
                        NoSuchPaddingException
get a cipher for the key

Returns:
a Cipher
Throws:
NoSuchAlgorithmException
NoSuchPaddingException

getAlgorithm

public static String getAlgorithm()
get the used algorithm

Returns:
a String

createSerializedKey

public static byte[] createSerializedKey(String algorithm_p)
                                  throws NoSuchAlgorithmException,
                                         IOException
create a secret key and return it as a serialized byte array

Parameters:
algorithm_p -
Returns:
the serialized byte array representing the secret key
Throws:
NoSuchAlgorithmException
IOException

createJavaCodeKeyDeclaration

public static String createJavaCodeKeyDeclaration(String algorithm_p)
                                           throws NoSuchAlgorithmException,
                                                  IOException
dump a java code byte array representation of a secret key

Parameters:
algorithm_p -
Returns:
String java code lines
Throws:
NoSuchAlgorithmException
IOException

main

public static void main(String[] args_p)
create a new java m_keybytes member

Parameters:
args_p -


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.