au.net.aba.crypto.spec
Class RC4KeySpec
java.lang.Object
|
+--au.net.aba.crypto.spec.RC4KeySpec
- public class RC4KeySpec
- extends java.lang.Object
- implements java.security.spec.KeySpec
A class that provides a specification for a RC4 key.
Field Summary |
static java.lang.String |
ident
|
Constructor Summary |
RC4KeySpec(byte[] key)
Uses the first 16 bytes in key as the RC4 key |
RC4KeySpec(byte[] key,
int len)
Uses the first len bytes in key as the RC4 key |
RC4KeySpec(byte[] key,
int offset,
int len)
Uses the first len bytes in key, beginning at offset, as the RC4 key |
Method Summary |
byte[] |
getKey()
Returns the RC4 key. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ident
public static final java.lang.String ident
RC4KeySpec
public RC4KeySpec(byte[] key)
throws java.security.InvalidKeyException
- Uses the first 16 bytes in key as the RC4 key
- Parameters:
key
- the bytes making up the key.- Throws:
- java.security.InvalidKeyException - if the key material is too short.
RC4KeySpec
public RC4KeySpec(byte[] key,
int len)
throws java.security.InvalidKeyException
- Uses the first len bytes in key as the RC4 key
- Parameters:
key
- the bytes making up the key.len
- the size (in bytes) of the key.- Throws:
- java.security.InvalidKeyException - if the key material is too short.
RC4KeySpec
public RC4KeySpec(byte[] key,
int offset,
int len)
throws java.security.InvalidKeyException
- Uses the first len bytes in key, beginning at offset, as the RC4 key
- Parameters:
key
- the bytes making up the key.offset
- the offset to start copying the key material.len
- the size (in bytes) of the key.- Throws:
- java.security.InvalidKeyException - if the key material is too short.
getKey
public byte[] getKey()
- Returns the RC4 key.
- Returns:
- the bytes making up the key.