Cryptix OpenPGP

cryptix.pki
Class PrincipalBuilder

java.lang.Object
  extended bycryptix.pki.PrincipalBuilder

public class PrincipalBuilder
extends java.lang.Object

A class for building a principal

Version:
$Revision: 1.2 $
Author:
Edwin Woudt

Constructor Summary
protected PrincipalBuilder(PrincipalBuilderSpi builderSpi, java.security.Provider provider, java.lang.String format)
          Create a new PrincipalBuilder object containing the given SPI object.
 
Method Summary
 java.security.Principal build(java.lang.Object contents)
          Returns a new principal based on the given contents.
 java.lang.String getFormat()
          Returns the name of the format of this object.
static PrincipalBuilder getInstance(java.lang.String format)
          Returns a PrincipalBuilder that implements the given format.
static PrincipalBuilder getInstance(java.lang.String format, java.security.Provider provider)
          Returns a PrincipalBuilder from the given provider that implements the given format.
static PrincipalBuilder getInstance(java.lang.String format, java.lang.String provider)
          Returns a PrincipalBuilder from the given provider that implements the given format.
 java.security.Provider getProvider()
          Returns the provider of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrincipalBuilder

protected PrincipalBuilder(PrincipalBuilderSpi builderSpi,
                           java.security.Provider provider,
                           java.lang.String format)
Create a new PrincipalBuilder object containing the given SPI object.

Method Detail

getInstance

public static PrincipalBuilder getInstance(java.lang.String format)
                                    throws java.security.NoSuchAlgorithmException
Returns a PrincipalBuilder that implements the given format.

Throws:
java.security.NoSuchAlgorithmException

getInstance

public static PrincipalBuilder getInstance(java.lang.String format,
                                           java.lang.String provider)
                                    throws java.security.NoSuchAlgorithmException,
                                           java.security.NoSuchProviderException
Returns a PrincipalBuilder from the given provider that implements the given format.

Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException

getInstance

public static PrincipalBuilder getInstance(java.lang.String format,
                                           java.security.Provider provider)
                                    throws java.security.NoSuchAlgorithmException
Returns a PrincipalBuilder from the given provider that implements the given format.

Throws:
java.security.NoSuchAlgorithmException

getProvider

public final java.security.Provider getProvider()
Returns the provider of this object.


getFormat

public final java.lang.String getFormat()
Returns the name of the format of this object.


build

public final java.security.Principal build(java.lang.Object contents)
                                    throws PrincipalException
Returns a new principal based on the given contents.

The parameter will probably be a String most of the times, however other things like an Image (for a photo) are also possible.

Throws:
PrincipalException - on a variety of format specific problems.

Cryptix OpenPGP

Copyright (C) 1999-2003 The Cryptix Foundation Ltd.