com.ibm.crypto.fips.provider

Class AESKeySpec

  1. java.lang.Object
  2. extended bycom.ibm.crypto.fips.provider.AESKeySpec
All implemented interfaces:
AlgorithmStatus, java.security.spec.KeySpec

  1. public class AESKeySpec
  2. extends java.lang.Object
  3. implements java.security.spec.KeySpec, AlgorithmStatus
This class specifies a AES key.
Version:
1.1, 07/23/03
Author:
Paschalis Kaltsatis

Constructor Summary

Constructor and Description
AESKeySpec(byte[] key)
Uses the bytes in key as the key material for the AES key.
AESKeySpec(byte[] key,int offset,int len)
Uses the bytes in key, beginning at offset inclusive, as the key material for the AES key.

Method Summary

Modifier and Type Method and Description
  1. byte[]
getKey()
Returns the AES key material.
  1. protected
  2. byte[]
internalGetKey()
  1. boolean
isFipsApproved()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AESKeySpec

  1. public AESKeySpec(byte[] key)
  2. throws java.security.InvalidKeyException
Uses the bytes in key as the key material for the AES key.

The bytes that constitute the AES key are those between key[0] and key[key.length - 1] inclusive.

Parameters:
key - the buffer with the AES key material.
Throws:
java.security.InvalidKeyException - if the given key material is not 16, 24, or 32 bytes.

AESKeySpec

  1. public AESKeySpec(byte[] key,
  2. int offset,
  3. int len)
  4. throws java.security.InvalidKeyException
Uses the bytes in key, beginning at offset inclusive, as the key material for the AES key.

The bytes that constitute the AES key are those between key[offset] and key[offset+len-1] inclusive.

Parameters:
key - the buffer with the AES key material.
offset - the offset in key, where the DES key material starts.
Throws:
java.security.InvalidKeyException - if the given key material, starting at offset inclusive, is not 16, 24, or 32 bytes.

Method Detail

isFipsApproved

  1. public boolean isFipsApproved()
Description copied from interface: AlgorithmStatus
Module identifies if the cryptographic operation (algorithm) is FIPS certified
Specified by:
See Also:

getKey

  1. public byte[] getKey()
Returns the AES key material.
Returns:
the AES key material.
Throws:
FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.

internalGetKey

  1. protected byte[] internalGetKey( )