aerogear-crypto 0.1.1

org.jboss.aerogear.crypto.keys
Class PrivateKey

java.lang.Object
  extended by org.jboss.aerogear.crypto.keys.PrivateKey

public class PrivateKey
extends Object

Represents the private key used for symmetric encryption


Field Summary
private  byte[] secretKey
           
 
Constructor Summary
PrivateKey()
          Initialize and generate the private key with the default key size
PrivateKey(byte[] keyBytes)
          Initializes the private key with the provided bytes
PrivateKey(String secretKey)
          Initializes the private key with the provided string
PrivateKey(String secretKey, Encoder encoder)
          Initializes the private key with the provided string and encoder
 
Method Summary
 byte[] toBytes()
          Retrieve the private key
 String toString()
          Retrieve the hexadecimal representation of the key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

secretKey

private byte[] secretKey
Constructor Detail

PrivateKey

public PrivateKey()
Initialize and generate the private key with the default key size


PrivateKey

public PrivateKey(byte[] keyBytes)
Initializes the private key with the provided bytes

Parameters:
keyBytes - provided key

PrivateKey

public PrivateKey(String secretKey)
Initializes the private key with the provided string

Parameters:
secretKey - provided key

PrivateKey

public PrivateKey(String secretKey,
                  Encoder encoder)
Initializes the private key with the provided string and encoder

Parameters:
secretKey - provided key
encoder - provided encoder
Method Detail

toBytes

public byte[] toBytes()
Retrieve the private key

Returns:
sequence of bytes representing the private key

toString

public String toString()
Retrieve the hexadecimal representation of the key

Overrides:
toString in class Object
Returns:
key encoded to hexadecimal by default

aerogear-crypto 0.1.1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.