Bees v0.5.0 API

bees.core.security
Class KeyFactory

java.lang.Object
  |
  +--bees.core.security.KeyFactory

public final class KeyFactory
extends java.lang.Object

A KeyFactory is used to create public and private keys from their respective KeySpecs.


Constructor Summary
KeyFactory()
          Construct an empty KeyFactory.
 
Method Summary
 PrivateKey createPrivateKey(PrivateKeySpec ks)
          Create a PrivateKey capability from the given values.
 PrivateKey createPrivateKey(PrivateKeySpec ks, java.lang.String comment)
          Create a PrivateKey capability from the given values.
 PublicKey createPublicKey(PublicKeySpec ks)
          Create a PublicKey capability from the given value with the default permissions.
 PublicKey createPublicKey(PublicKeySpec ks, PermissionSet ps)
          Create a PublicKey capability from the given values.
 PublicKey createPublicKey(PublicKeySpec ks, PermissionSet ps, java.lang.String comment)
          Create a PublicKey capability from the given values.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyFactory

public KeyFactory()
Construct an empty KeyFactory.
Method Detail

createPrivateKey

public PrivateKey createPrivateKey(PrivateKeySpec ks,
                                   java.lang.String comment)
                            throws java.security.NoSuchAlgorithmException,
                                   java.security.spec.InvalidKeySpecException
Create a PrivateKey capability from the given values.
Parameters:
ks - The key specification.
comment - A comment describing the key.
Returns:
A new PrivateKey capability.
Throws:
java.security.NoSuchAlgorithmException - if the key algorithm is not available.
java.security.spec.InvalidKeySpecException - if the key spec is not valid.

createPrivateKey

public PrivateKey createPrivateKey(PrivateKeySpec ks)
                            throws java.security.NoSuchAlgorithmException,
                                   java.security.spec.InvalidKeySpecException
Create a PrivateKey capability from the given values.
Parameters:
ks - The key specification.
Returns:
A new PrivateKey capability.
Throws:
java.security.NoSuchAlgorithmException - if the key algorithm is not available.
java.security.spec.InvalidKeySpecException - if the key spec is not valid.

createPublicKey

public PublicKey createPublicKey(PublicKeySpec ks,
                                 PermissionSet ps,
                                 java.lang.String comment)
                          throws java.security.NoSuchAlgorithmException,
                                 java.security.spec.InvalidKeySpecException
Create a PublicKey capability from the given values.
Parameters:
ks - The key specification.
ps - The permissions for the new capability.
comment - A comment describing the key.
Returns:
A new PublicKey capability.
Throws:
java.security.NoSuchAlgorithmException - if the key algorithm is not available.
java.security.spec.InvalidKeySpecException - if the key spec is not valid.

createPublicKey

public PublicKey createPublicKey(PublicKeySpec ks,
                                 PermissionSet ps)
                          throws java.security.NoSuchAlgorithmException,
                                 java.security.spec.InvalidKeySpecException
Create a PublicKey capability from the given values.
Parameters:
ks - The key specification.
ps - The permissions for the new capability.
Returns:
A new PrivateKey capability.
Throws:
java.security.NoSuchAlgorithmException - if the key algorithm is not available.
java.security.spec.InvalidKeySpecException - if the key spec is not valid.

createPublicKey

public PublicKey createPublicKey(PublicKeySpec ks)
                          throws java.security.NoSuchAlgorithmException,
                                 java.security.spec.InvalidKeySpecException
Create a PublicKey capability from the given value with the default permissions.
Parameters:
ks - The key specification.
Returns:
A new PrivateKey capability.
Throws:
java.security.NoSuchAlgorithmException - if the key algorithm is not available.
java.security.spec.InvalidKeySpecException - if the key spec is not valid.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

Bees v0.5.0 API

This documentation is Copyright (C) 2002 The University of Utah. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for Bees v0.5.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/