Class KeyReader

    • Field Detail

      • getPublicKey

        public Parameter getPublicKey
        True if we should get the public key. False if we should get the private key. The default value is true. Getting the private key requires using the keyPassword.
      • output

        public TypedIOPort output
        The output port. This port contains an KeyToken that contains a java.security.Key.
      • trigger

        public TypedIOPort trigger
        The trigger port. The type of this port is undeclared, meaning that it will resolve to any data type.
      • signatureAlgorithm

        public StringParameter signatureAlgorithm
        The name of the signature algorithm used to generate the key. This StringParameter is not settable by the user, it is set after initialize() is called and the certificate has been obtained from the KeyStore.
      • verifyCertificate

        public Parameter verifyCertificate
        True if the certificate associated with a key should be verified. False if the certificate (if any) need not be verified.
        Public Keys must be associated with a certificate, so if getPublicKey is true, then this Parameter should be true as well.
        Private keys are usually associated with a certificate, so verifying the certificate is a good idea.
        Secret keys do not usually have a certificate, so if the key is a secret key, then usually verifyCertificate is set to false.
    • Method Detail

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        Override the base class to reinitialize the state if the alias, fileOrURL, or getPublicKey parameter is changed.
        Overrides:
        attributeChanged in class KeyStoreActor
        Parameters:
        attribute - The attribute that has changed.
        Throws:
        IllegalActionException - If the specified attribute is URL and the file cannot be opened.
      • fire

        public void fire()
                  throws IllegalActionException
        Output the java.security.Key that was read in. Read at most one input token from each channel of the trigger input and discard it. If the trigger input is not connected, then this method does nothing. Derived classes should be sure to call super.fire(), or to consume the trigger input tokens themselves, so that they aren't left unconsumed.
        Specified by:
        fire in interface Executable
        Overrides:
        fire in class KeyStoreActor
        Throws:
        IllegalActionException - Not thrown in this base class.
        IllegalActionException - If there's no director.
      • _updateKey

        protected void _updateKey()
                           throws IllegalActionException
        If necessary, update _key by using the values of the alias, fileOrURL and getPublicKey parameters.
        Throws:
        IllegalActionException - If the parent class throws it or if there is a problem with the cryptographic configuration.