Class SignatureActor

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
    Direct Known Subclasses:
    SignatureSigner, SignatureVerifier

    public class SignatureActor
    extends TypedAtomicActor
    A common base class for actors that use cryptographic signatures.

    In cryptography, digital signatures can be used to verify that the data was not modified in transit. However, the data itself is passed in clear text.

    The signature algorithms that maybe implemented are limited to the signature algorithms that are implemented by providers following the JCE specifications and installed on the machine being run. In case a provider specific instance of an algorithm is needed, the provider may also be specified in the provider parameter.

    The input and output are both arrays of unsigned bytes.

    In initialize(), this actor sets the value of the _signature member to the results of calling java.security.Signature.getInstance() with the values of the signatureAlgorithm and provider parameters. Derived classes should have a fire() method that uses the _signature member to process data appropriately. In the fire() method of the derived class, super.fire() should be called before accessing _signature so that _signature may be updated if the attributes changed.

    This actor relies on the Java Cryptography Architecture (JCA) and Java Cryptography Extension (JCE). See the CryptographyActor documentation for resources about JCA and JCE.

    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Christopher Hylands Brooks, Contributor: Rakesh Reddy
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Yellow (cxh)
    • Field Detail

      • input

        public TypedIOPort input
        This port takes in an unsigned byte array and processes the data.
      • output

        public TypedIOPort output
        This port sends out the processed data received from input in the form of an unsigned byte array.
      • provider

        public StringParameter provider
        Specify a provider for the given algorithm. Takes the algorithm name as a string. The default value is "SystemDefault" which allows the system chooses the provider based on the JCE architecture.
      • signatureAlgorithm

        public StringParameter signatureAlgorithm
        Specify the algorithm to be used to sign 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 system. Depending on your JDK installation, possible values might be SHA1WITHDSA or MD5WITHRSA. The initial default is the first value returned by java.security.Security.getAlgorithms("Signature").
      • _provider

        protected java.lang.String _provider
        The name of the provider to be used for a provider specific implementation.
      • _signature

        protected java.security.Signature _signature
        The signature that will be used to process the data.
      • _signatureAlgorithm

        protected java.lang.String _signatureAlgorithm
        The name of the signature algorithm to be used.
    • Constructor Detail

      • SignatureActor

        public SignatureActor​(CompositeEntity container,
                              java.lang.String name)
                       throws NameDuplicationException,
                              IllegalActionException
        Construct an actor with the given container and name. The Java virtual machine is queried for algorithm and provider choices and these choices are added to the appropriate parameters.
        Parameters:
        container - The container.
        name - The name of this actor.
        Throws:
        IllegalActionException - If the actor cannot be contained by the proposed container.
        NameDuplicationException - If the container already has an actor with this name.