bees.core.security
Class KeyGenerator
java.lang.Object
|
+--bees.core.security.KeyGenerator
- public final class KeyGenerator
- extends java.lang.Object
A KeyGenerator is used to manufacture new SecretKey capabilities.
Constructor Summary |
KeyGenerator()
Construct an empty KeyGenerator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
KeyGenerator
public KeyGenerator()
- Construct an empty KeyGenerator.
generateKey
public SecretKey generateKey(java.lang.String algorithm,
int strength,
PermissionSet ps,
java.lang.String comment)
throws java.security.NoSuchAlgorithmException
- Generate a new key from the given values.
- Parameters:
algorithm
- The type of key to generate.strength
- The suggested number of bits the key should have.comment
- A comment to attach to the capability.ps
- The permissions for the new capability.- Returns:
- A SecretKey capability.
- Throws:
java.security.NoSuchAlgorithmException
- if "algorithm" is not available.
generateKey
public SecretKey generateKey(java.lang.String algorithm,
int strength,
PermissionSet ps)
throws java.security.NoSuchAlgorithmException
- Generate a new key from the given values.
- Parameters:
algorithm
- The type of key to generate.strength
- The suggested number of bits the key should have.ps
- The permissions for the new capability.- Returns:
- A SecretKey capability.
- Throws:
java.security.NoSuchAlgorithmException
- if "algorithm" is not available.
generateKey
public SecretKey generateKey(java.lang.String algorithm,
int strength)
throws java.security.NoSuchAlgorithmException
- Generate a new key from the given values and default permissions.
- Parameters:
algorithm
- The type of key to generate.strength
- The suggested number of bits the key should have.- Returns:
- A SecretKey capability.
- Throws:
java.security.NoSuchAlgorithmException
- if "algorithm" is not available.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- See Also:
Object.toString()
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/