spki
Class PrincipalFactory

java.lang.Object
  |
  +--spki.PrincipalFactory

public final class PrincipalFactory
extends Object

SPKI PrincipalFactory utility class.

Version:
$Id: PrincipalFactory.java,v 1.2 2002/07/02 19:31:01 tep Exp $
Author:
Tep Narula <tep@win.trlabs.ca>
See Also:
Principal

Field Summary
private static String __ME
          This class's full name.
 
Constructor Summary
private PrincipalFactory()
          Can't instantiate me.
 
Method Summary
static Principal getInstance(SExpression sexp)
          Get an instance of principal from given S-Expression.
static boolean isPrincipal(SExpression sexp)
          Check an SExpression to see if it could contain a principal.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

__ME

private static final String __ME
This class's full name.
Constructor Detail

PrincipalFactory

private PrincipalFactory()
Can't instantiate me. Thsi is a tool class, we don't want to create an instance!
Method Detail

isPrincipal

public static final boolean isPrincipal(SExpression sexp)
Check an SExpression to see if it could contain a principal. It's a convenient utility function that checks whether the given SExpressions is an SList that has a matching type-name as one of those classes that are considered principal.
Parameters:
sexp - the SExpression to check.
Returns:
true if given SExpression could contain be a principal, false otherwise.

getInstance

public static final Principal getInstance(SExpression sexp)
                                   throws SPKIException,
                                          ParseException
Get an instance of principal from given S-Expression.
Parameters:
sexp - the SExpression to check.
Returns:
an instance of spki.interfaces.Principal.
Throws:
ParseException - if the argument doesn't contain a principal.
SPKIException - if something went wrong.