net.ninthtest.crypto.provider.helix
Class HelixParameterSpec

java.lang.Object
  extended by net.ninthtest.crypto.provider.helix.HelixParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec

public class HelixParameterSpec
extends Object
implements AlgorithmParameterSpec

Specifies the nonce (i.e. initialization vector) and optional MAC for Helix cryptographic operations.

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

Constructor Summary
HelixParameterSpec(byte[] nonce)
          Creates a new HelixParameterSpec instance using bytes from nonce as the Helix nonce.
HelixParameterSpec(byte[] nonce, byte[] expectedMac)
          Creates a new HelixParameterSpec instance using bytes from nonce and expectedMac as the Helix nonce and MAC, respectively.
 
Method Summary
 byte[] getMac()
          Returns the MAC used to authenticate a message.
 byte[] getNonce()
          Returns the nonce used in a Helix cryptographic operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelixParameterSpec

public HelixParameterSpec(byte[] nonce)
Creates a new HelixParameterSpec instance using bytes from nonce as the Helix nonce.

Parameters:
nonce - a 16-byte array whose contents will be copied for use as the Helix nonce (i.e. initialization vector) in an encryption or decryption operation
Throws:
NullPointerException - if nonce is null
IllegalArgumentException - if nonce is not exactly 16 bytes in length

HelixParameterSpec

public HelixParameterSpec(byte[] nonce,
                          byte[] expectedMac)
Creates a new HelixParameterSpec instance using bytes from nonce and expectedMac as the Helix nonce and MAC, respectively.

Parameters:
nonce - a 16-byte array whose contents will be copied for use as the Helix nonce (i.e. initialization vector) in an encryption or decryption operation
expectedMac - a 16-byte array whose contents will be copied for use as the Helix MAC to authenticate a message
Throws:
NullPointerException - if either nonce or expectedMac is null
IllegalArgumentException - if either nonce or expectedMac is not exactly 16 bytes in length
Method Detail

getNonce

public byte[] getNonce()
Returns the nonce used in a Helix cryptographic operation.

Returns:
a copy of the 16-byte nonce

getMac

public byte[] getMac()
Returns the MAC used to authenticate a message.

Returns:
a copy of the 16-byte MAC, or null if the MAC was not specified for this instance


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