Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Cryptix V3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## cryptix.provider.key
Class RawKey

    java.lang.Object
      |
      +--cryptix.provider.key.RawKey

Direct Known Subclasses:
  RawSecretKey

public class RawKey
extends 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 $

Since:
  Cryptix 2.2.2
Author:
  David Hopwood, Raïf S. Naffah, Ian Brown
See Also:
  Serialized Form

Fields inherited from interface java.security.Key
`serialVersionUID`

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()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### 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
  Throws:
    NullPointerException - if algorithm == null || data == null

### 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
  Throws:
    NullPointerException - if algorithm == null || data == null

Method Detail

### hashCode

    public int hashCode()

  Overrides:
    hashCode in class Object

### equals

    public boolean equals(Object obj)

  Overrides:
    equals in class Object

### getAlgorithm

    public String getAlgorithm()

  Specified by:
    getAlgorithm in interface Key
  Returns:
    the standard algorithm name this key was generated for.

### getFormat

    public String getFormat()

  Specified by:
    getFormat in interface Key
  Returns:
    the format used to encode this key. For this class it's always `RAW`.

### getEncoded

    public byte[] getEncoded()

  Specified by:
    getEncoded in interface Key
  Returns:
    a copy of the raw-encoded key data

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Cryptix V3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) 1995-2000 The Cryptix Foundation Ltd. All rights reserved.