jsdsi
Class PublicKey

java.lang.Object
  extended byjsdsi.Obj
      extended byjsdsi.Principal
          extended byjsdsi.PublicKey
All Implemented Interfaces:
Element, java.security.Key, java.security.Principal, java.security.PublicKey, java.io.Serializable, Subject
Direct Known Subclasses:
RSAPublicKey

public abstract class PublicKey
extends Principal
implements Element, java.security.PublicKey

A public key.

Version:
$Revision: 1.7.2.1 $ $Date: 2005/11/08 03:12:52 $
Author:
Sameer Ajmani, Sean Radford
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class jsdsi.Element
Element.Default
 
Nested classes inherited from class jsdsi.Subject
Subject.Default
 
Field Summary
 
Fields inherited from class jsdsi.Obj
_obj
 
Constructor Summary
PublicKey(java.lang.String a)
          Creates a new PublicKey from an algorithm name.
PublicKey(java.lang.String a, java.net.URI[] u)
          Creates a new PublicKey for a given algorithm name and list of URIs.
PublicKey(java.lang.String a, java.net.URL[] u)
          Deprecated. use PublicKey(String, URI[])
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getAlgorithm()
           
 byte[] getEncoded()
           
 java.lang.String getFormat()
           
 java.net.URI[] getURIs()
           
 java.net.URL[] getURLs()
          Deprecated. use getURIs()
 int hashCode()
           
 PublicKeyHash publicKeyHash(DigestAlgoEnum da)
          Generate the corresponding PublicKeyHash for this PublicKey.
 boolean samePrincipalAs(Principal p)
          Compares this Principal with another.
 SexpList toSexp()
          Creates an SexpList -representation from this SDSI-object.
 
Methods inherited from class jsdsi.Principal
getName
 
Methods inherited from class jsdsi.Obj
parseObj, parseObj, readResolve, toByteArray, toString, toString, toTransport
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
toString
 

Constructor Detail

PublicKey

public PublicKey(java.lang.String a,
                 java.net.URL[] u)
Deprecated. use PublicKey(String, URI[])

Creates a new PublicKey for a given algorithm name and list of URLs.

Parameters:
a - name of the algorithm used.
u - list of URLs (may be null).

PublicKey

public PublicKey(java.lang.String a,
                 java.net.URI[] u)
Creates a new PublicKey for a given algorithm name and list of URIs.

Parameters:
a - name of the algorithm used.
u - list of URIs (may be null).

PublicKey

public PublicKey(java.lang.String a)
Creates a new PublicKey from an algorithm name.

Parameters:
a - name of the algorithm name used.
Method Detail

getAlgorithm

public java.lang.String getAlgorithm()
Specified by:
getAlgorithm in interface java.security.Key
See Also:
Key.getAlgorithm()

getFormat

public java.lang.String getFormat()
Specified by:
getFormat in interface java.security.Key
See Also:
Key.getFormat()

getEncoded

public byte[] getEncoded()
Specified by:
getEncoded in interface java.security.Key
See Also:
Key.getEncoded()

getURLs

public java.net.URL[] getURLs()
Deprecated. use getURIs()

Returns:
a list of URLs of this PublicKey.

getURIs

public java.net.URI[] getURIs()
Specified by:
getURIs in class Principal
Returns:
the list of URIs where information about this PublicKey maybe found.

publicKeyHash

public PublicKeyHash publicKeyHash(DigestAlgoEnum da)
Generate the corresponding PublicKeyHash for this PublicKey.

Parameters:
da - the digest algorithm for the hash function.
Returns:

samePrincipalAs

public boolean samePrincipalAs(Principal p)
Description copied from class: Principal
Compares this Principal with another.

Specified by:
samePrincipalAs in class Principal
Parameters:
p - another principal to compare this one with.
Returns:
true if both principal are the same (with respect to their public key), false otherwise.
See Also:
Principal.samePrincipalAs(Principal)

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.security.Principal
Specified by:
equals in class Obj
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Specified by:
hashCode in interface java.security.Principal
Specified by:
hashCode in class Obj
See Also:
Object.hashCode()

toSexp

public final SexpList toSexp()
Description copied from class: Obj
Creates an SexpList -representation from this SDSI-object.

Specified by:
toSexp in interface Element
Specified by:
toSexp in class Obj
Returns:
an SexpList that represents this SDSI-object.


Copyright © 2002-2006 JSDSI. All Rights Reserved.