cryptix.provider.key

Class RawKey

Implemented Interfaces:
Key
Known Direct Subclasses:
RawSecretKey

public class RawKey
extends java.lang.Object
implements Key

RawKey implements a key in raw format, represented as a byte array.

Copyright © 1997-1998 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.3 $

Authors:
David Hopwood
Raïf S. Naffah
Ian Brown

Since:
Cryptix 2.2.2

Constructor Summary

RawKey(String algorithm, byte[] data)
Constructs a key with the specified algorithm name and raw-encoded data array.
RawKey(String algorithm, byte[] data, int offset, int length)
Constructs a secret key with the specified algorithm and raw-encoded data subarray.

Method Summary

boolean
equals(Object obj)
String
getAlgorithm()
byte[]
getEncoded()
String
getFormat()
int
hashCode()

Constructor Details

RawKey

public RawKey(String algorithm,
              byte[] data)
Constructs a key with the specified algorithm name and raw-encoded data array.

Parameters:
algorithm - the name of the algorithm
data - the key's raw-encoded data


RawKey

public RawKey(String algorithm,
              byte[] data,
              int offset,
              int length)
Constructs a secret key with the specified algorithm and raw-encoded data subarray.

Parameters:
algorithm - the name of the algorithm
data - the key's raw-encoded data
offset - the offset of the encoding in data
length - the length of the encoding

Method Details

equals

public boolean equals(Object obj)


getAlgorithm

public String getAlgorithm()

Returns:
the standard algorithm name this key was generated for.


getEncoded

public byte[] getEncoded()

Returns:
a copy of the raw-encoded key data


getFormat

public String getFormat()

Returns:
the format used to encode this key. For this class it's always RAW.


hashCode

public int hashCode()