net.ninthtest.crypto.provider.helix
Class HelixKeySpec

java.lang.Object
  extended by net.ninthtest.crypto.provider.helix.HelixKeySpec
All Implemented Interfaces:
KeySpec

public class HelixKeySpec
extends Object
implements KeySpec

A (transparent) specification of the key material that constitutes a Helix secret key.

Version:
1.0
Author:
Matthew Zipay (mattz@ninthtest.info)

Constructor Summary
HelixKeySpec(byte[] key)
          Creates a new HelixKeySpec using the first 32 bytes from key as the key material for the Helix key.
HelixKeySpec(byte[] key, int offset)
          Creates a new HelixKeySpec using the first 32 bytes from key, beginning at offset (inclusive), as the key material for the Helix key.
 
Method Summary
 byte[] getKey()
          Returns the key material for the Helix cryptographic key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelixKeySpec

public HelixKeySpec(byte[] key)
Creates a new HelixKeySpec using the first 32 bytes from key as the key material for the Helix key.

If key contains less than 32 bytes, only key.length bytes of key material will be used.

Parameters:
key - the buffer containing Helix key material (bytes are copied to protect against subsequent modification)

HelixKeySpec

public HelixKeySpec(byte[] key,
                    int offset)
Creates a new HelixKeySpec using the first 32 bytes from key, beginning at offset (inclusive), as the key material for the Helix key.

A maximum of 32 bytes of key material will be used. In other words, the number of bytes of key material will be the lesser of (key.length - offset) and 32.

Parameters:
key - the buffer containing Helix key material (bytes are copied to protect against subsequent modification)
offset - the index into key where the Helix key material begins
Method Detail

getKey

public byte[] getKey()
Returns the key material for the Helix cryptographic key.

Returns:
a copy of the Helix key material


Copyright © 2010-2014 Matthew Zipay. All Rights Reserved.