
CryptographyActor |
ptolemy.actor.lib.security.CryptographyActor |
A base class for cryptographic actors.
<p>Cryptographic actors are actors that perform encryption or decryption or
generate signatures of data.
<p>Actors extending this class take in an unsigned byte array at the
<i>input</i>, process the data based on the <i>algorithm</i> parameter
and send an unsigned byte array to the <i>output</i>. The algorithms
that maybe implemented are limited those that are implemented by
"providers" following the Java Cryptography Extension (JCE)
specifications and installed on the machine being run.
If a provider specific instance of an algorithm is
needed, the provider may be specified in the <i>provider</i>
parameter. The <i>keySize</i> also allows implementations of
algorithms using various key sizes.
<p>Concrete actors derived from this base class must include a
<a href="../../../../ptolemy/actor/lib/security/CryptographyActor.html#_process">_process(byte[])</a> method that processes the data appropriately.
The _process() method is called by CryptographyActor.fire().
This class takes care of basic initialization of the <i>algorithm</i>
and <i>provider</i> parameters for use by the subclasses.
<p>This actor relies on the Java Cryptography Architecture (JCA) and Java
Cryptography Extension (JCE).
<br>Information about JCA can be found at
<a href="http://java.sun.com/j2se/1.4.2/docs/guide/security/CryptoSpec.html" target="_top">http://java.sun.com/j2se/1.4.2/docs/guide/security/CryptoSpec.html</a>.
<br>Information about JCE can be found at
<a href="http://java.sun.com/products/jce/" target="_top">http://java.sun.com/products/jce/</a>.
<br>The Java 1.2 security tutorial can be found at
<a href="http://java.sun.com/docs/books/tutorial/security1.2/index.html" target="_top">http://java.sun.com/docs/books/tutorial/security1.2/index.html</a>
<br>Another Java security tutorial can be found at
<a href="http://developer.java.sun.com/developer/onlineTraining/Security/Fundamentals/index.html" target="_top">http://developer.java.sun.com/developer/onlineTraining/Security/Fundamentals/index.html</a>
Author(s): Christopher Hylands Brooks, Contributor: Rakesh Reddy
Version:$Id: CryptographyActor.doc.html,v 1.1 2006/02/22 18:40:26 mangal Exp $
Pt.Proposed Rating:Green (cxh)
Pt.Accepted Rating:Yellow (cxh)
input
The input port. The type of this port is unsigned byte array.
Data is read in on this port, processed by the _process() method
during fire() and passed to the <i>output</i> port.
output
The output port. The type of this port is unsigned byte array.
This port sends out the processed data received from the <i>input</i>
port.
algorithm
Specify the algorithm to be used to process data.
The algorithm is specified as a string. The algorithms are
limited to those implemented by providers using the Java JCE
which are found on the Java virtual machine. The initial
default is the first value returned by
java.security.Security.getAlgorithms();
keySize
Specify the size of the key to be created.
The key size is an integer value representing the number of bits in
the key. The initial default depends on the algorithm that is
selected, not all algorithms use <i>keySize</i>.
In addition, only certain keySizes may work with certain
algorithms, see the documentation for the algorithm you are using.
<p>DSA is the most common algorithm that uses <i>keySize</i>, the Sun
documentation says:
"The length, in bits, of the modulus p. This must range from
512 to 1024, and must be a multiple of 64. The default keysize
is 1024."
Refer to
<a href="http://java.sun.com/j2se/1.4.2/docs/guide/security/CryptoSpec.html#AppB" target="_top">http://java.sun.com/j2se/1.4.2/docs/guide/security/CryptoSpec.html#AppB</a>
for a list of possible key sizes for certain algorithms.
The initial default is 1024.
provider
Specify a provider for the given algorithm.
The default value is "SystemDefault" which allows the
system to choose the provider based on the JCE architecture.