Cryptix OpenPGP

cryptix.pki
Class CertificateBuilder

java.lang.Object
  extended bycryptix.pki.CertificateBuilder

public class CertificateBuilder
extends java.lang.Object

A class for building a Certificate

Version:
$Revision: 1.2 $
Author:
Edwin Woudt

Constructor Summary
protected CertificateBuilder(CertificateBuilderSpi builderSpi, java.security.Provider provider, java.lang.String format)
          Create a new CertificateBuilder object containing the given SPI object.
 
Method Summary
 java.security.cert.Certificate build(java.security.PublicKey subjectKey, java.security.Principal subjectName, KeyBundle issuer, char[] passphrase, java.security.SecureRandom sr)
          Returns a new Certificate based on the given subject key, subject name and Issuer.
 java.security.cert.Certificate build(java.security.PublicKey subjectKey, java.security.Principal subjectName, KeyBundle issuer, char[] passphrase, java.security.SecureRandom sr, java.security.spec.AlgorithmParameterSpec algSpec)
          Returns a new Certificate based on the given subject key, subject name and Issuer.
 java.security.cert.Certificate build(java.security.PublicKey subjectKey, java.security.Principal subjectName, java.security.PrivateKey issuer, java.security.SecureRandom sr)
          Returns a new Certificate based on the given subject key, subject name and Issuer.
 java.security.cert.Certificate build(java.security.PublicKey subjectKey, java.security.Principal subjectName, java.security.PrivateKey issuer, java.security.SecureRandom sr, java.security.spec.AlgorithmParameterSpec algSpec)
          Returns a new Certificate based on the given subject key, subject name and Issuer.
 java.lang.String getFormat()
          Returns the name of the format of this object.
static CertificateBuilder getInstance(java.lang.String format)
          Returns a CertificateBuilder that implements the given format.
static CertificateBuilder getInstance(java.lang.String format, java.security.Provider provider)
          Returns a CertificateBuilder from the given provider that implements the given format.
static CertificateBuilder getInstance(java.lang.String format, java.lang.String provider)
          Returns a CertificateBuilder 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

CertificateBuilder

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

Method Detail

getInstance

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

Throws:
java.security.NoSuchAlgorithmException

getInstance

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

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

getInstance

public static CertificateBuilder getInstance(java.lang.String format,
                                             java.security.Provider provider)
                                      throws java.security.NoSuchAlgorithmException
Returns a CertificateBuilder 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.cert.Certificate build(java.security.PublicKey subjectKey,
                                                  java.security.Principal subjectName,
                                                  KeyBundle issuer,
                                                  char[] passphrase,
                                                  java.security.SecureRandom sr)
                                           throws java.security.cert.CertificateException,
                                                  java.security.UnrecoverableKeyException
Returns a new Certificate based on the given subject key, subject name and Issuer.

This method will generally need to execute a cryptographic signing operation, so it could take a while to execute.

Parameters:
subjectKey - the key that will be binded to the principal by the resulting certificate.
subjectName - the principal that will be binded to the key by the resulting certificate.
issuer - the keybundle that issues this certificate.
passphrase - the passphrase to decrypt the private key.
sr - a randomness source.
Throws:
java.security.cert.CertificateException - on a variety of format specific problems.
java.security.UnrecoverableKeyException - on an invalid passphrase.

build

public final java.security.cert.Certificate build(java.security.PublicKey subjectKey,
                                                  java.security.Principal subjectName,
                                                  KeyBundle issuer,
                                                  char[] passphrase,
                                                  java.security.SecureRandom sr,
                                                  java.security.spec.AlgorithmParameterSpec algSpec)
                                           throws java.security.cert.CertificateException,
                                                  java.security.InvalidAlgorithmParameterException,
                                                  java.security.UnrecoverableKeyException
Returns a new Certificate based on the given subject key, subject name and Issuer.

This method will generally need to execute a cryptographic signing operation, so it could take a while to execute.

Parameters:
subjectKey - the key that will be binded to the principal by the resulting certificate.
subjectName - the principal that will be binded to the key by the resulting certificate.
issuer - the keybundle that issues this certificate.
passphrase - the passphrase to decrypt the private key.
sr - a randomness source.
algSpec - an algorithm parameter specification.
Throws:
java.security.cert.CertificateException - on a variety of format specific problems.
java.security.InvalidAlgorithmParameterException - on invalid parameters.
java.security.UnrecoverableKeyException - on an invalid passphrase.

build

public final java.security.cert.Certificate build(java.security.PublicKey subjectKey,
                                                  java.security.Principal subjectName,
                                                  java.security.PrivateKey issuer,
                                                  java.security.SecureRandom sr)
                                           throws java.security.cert.CertificateException
Returns a new Certificate based on the given subject key, subject name and Issuer.

This method will generally need to execute a cryptographic signing operation, so it could take a while to execute.

Parameters:
subjectKey - the key that will be binded to the principal by the resulting certificate.
subjectName - the principal that will be binded to the key by the resulting certificate.
issuer - the private key that issues this certificate.
sr - a randomness source.
Throws:
java.security.cert.CertificateException - on a variety of format specific problems.

build

public final java.security.cert.Certificate build(java.security.PublicKey subjectKey,
                                                  java.security.Principal subjectName,
                                                  java.security.PrivateKey issuer,
                                                  java.security.SecureRandom sr,
                                                  java.security.spec.AlgorithmParameterSpec algSpec)
                                           throws java.security.cert.CertificateException,
                                                  java.security.InvalidAlgorithmParameterException
Returns a new Certificate based on the given subject key, subject name and Issuer.

This method will generally need to execute a cryptographic signing operation, so it could take a while to execute.

Parameters:
subjectKey - the key that will be binded to the principal by the resulting certificate.
subjectName - the principal that will be binded to the key by the resulting certificate.
issuer - the private key that issues this certificate.
sr - a randomness source.
algSpec - an algorithm parameter specification.
Throws:
java.security.cert.CertificateException - on a variety of format specific problems.
java.security.InvalidAlgorithmParameterException - on invalid parameters.

Cryptix OpenPGP

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