Class SignatureSigner

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

    public class SignatureSigner
    extends SignatureActor
    Sign the input data using a private key.

    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 provider and signatureAlgorithm parameters should be set to the values used to generate the privateKey. See PrivateKeyReader and SignatureActor for possible values.

    The provider and signatureAlgorithm parameters should be set to the same value as the corresponding parameters in the SignatureVerifier actor.

    Each time fire() is called, the privateKey is used to create a signature for each block of unsigned byte array data read from the input port. The signed data is passed to a SignatureVerifier actor on the signature port as an unsigned byte array.

    The input data itself is passed to in clear text on the output port.

    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
    See Also:
    PrivateKeyReader
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Yellow (cxh)
    • Field Detail

      • privateKey

        public TypedIOPort privateKey
        The private key to be used by the SignatureVerifier actor to verify the data on the output port. The type of this input port is an ObjectToken containing a java.security.PrivateKey.
      • signature

        public TypedIOPort signature
        The signature of the data. The type of this output port is unsigned byte array. The data is read in on the input port and the signature is generated on this port. The output port contains the data in clear text.
    • Method Detail

      • fire

        public void fire()
                  throws IllegalActionException
        Create a signature for the input data and send the signature to the signature port. The output port contains the data in clear text.
        Specified by:
        fire in interface Executable
        Overrides:
        fire in class SignatureActor
        Throws:
        IllegalActionException - If calling send(), super.fire() throws it, or if there is a problem cryptographic configuration.