spki.interfaces
Interface Key

All Known Implementing Classes:
PrivateKey, PublicKey

public interface Key
extends SPKIObject, SeqEntry

SPKI Key interface.

Version:
$Id: Key.java,v 1.6 2002/07/12 18:56:22 tep Exp $
Author:
Tep Narula <tep@win.trlabs.ca> adapted from SPKI.SPKIKey by Per Harald Myrvang <perm@pasta.cs.uit.no>

Method Summary
 String getAlgId()
          Get the SPKI encryption/signature algorithm id associated with the key.
 Key getJCAKey()
          Get a key object usable by [I]JCA packages.
 Hash getKeyHash()
          Get a Hash representing this key using the default hash algorithm.
 Hash getKeyHash(String hashAlg)
          Get a Hash representing this key using the specified hashing algorithm.
 String getKeyId()
          Get the key-id of this key.
 

Method Detail

getAlgId

public String getAlgId()
Get the SPKI encryption/signature algorithm id associated with the key.
Returns:
String containing a SPKI algorithm-id.

getJCAKey

public Key getJCAKey()
Get a key object usable by [I]JCA packages.
Returns:
java.security.Key object implementing, or null if this is a private key.

getKeyHash

public Hash getKeyHash()
                throws SPKIException
Get a Hash representing this key using the default hash algorithm.
Returns:
Hash object representing this key.
Throws:
SPKIException - if something went wrong

getKeyHash

public Hash getKeyHash(String hashAlg)
                throws SPKIException
Get a Hash representing this key using the specified hashing algorithm.
Parameters:
hashAlg - hashing algorithm-id to use.
Returns:
Hash object representing this key.
Throws:
SPKIException - if something went wrong

getKeyId

public String getKeyId()
                throws SPKIException
Get the key-id of this key. Key-id is a Base64-encoded hash value, using the default hash algorithm.
Returns:
String containing the key-id, or null.
Throws:
SPKIException - if something went wrong