de.fhg.igd.crypto
Class RawKey

java.lang.Object
  extended by de.fhg.igd.crypto.RawKey
All Implemented Interfaces:
Serializable, Key, SecretKey

public class RawKey
extends Object
implements SecretKey

Provides the creation of raw keys from arbitrary byte arrays, for instance to initialize a message authentification code algorithm.

Version:
"$Id: RawKey.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Jan Peters
See Also:
Serialized Form

Field Summary
private  byte[] rawKey_
          Stores the key in its raw format.
 
Fields inherited from interface java.security.Key
serialVersionUID
 
Constructor Summary
RawKey(byte[] rawKey)
          Creates an instance with the given raw key.
 
Method Summary
 String getAlgorithm()
          Returns the standard algorithm name for this key.
 byte[] getEncoded()
          Returns the key in its primary encoding format.
 String getFormat()
          Returns the name of the primary encoding format of this key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rawKey_

private byte[] rawKey_
Stores the key in its raw format.

Constructor Detail

RawKey

public RawKey(byte[] rawKey)
Creates an instance with the given raw key.

Parameters:
rawKey - The key in its raw format.
Throws:
NullPointerException, - if rawKey is null.
Method Detail

getAlgorithm

public String getAlgorithm()
Returns the standard algorithm name for this key.

Specified by:
getAlgorithm in interface Key
Returns:
The name of the algorithm associated with this key.

getEncoded

public byte[] getEncoded()
Returns the key in its primary encoding format.

Specified by:
getEncoded in interface Key
Returns:
The encoded key

getFormat

public String getFormat()
Returns the name of the primary encoding format of this key.

Specified by:
getFormat in interface Key
Returns:
The primary encoding format of the key.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.