Class SymmetricKeyCryptographyService

    • Constructor Detail

      • SymmetricKeyCryptographyService

        public SymmetricKeyCryptographyService()
    • Method Detail

      • doService

        public void doService​(AdaptrisMessage msg)
                       throws ServiceException
        Description copied from interface: Service

        Apply the service to the message.

        Parameters:
        msg - the AdaptrisMessage to process
        Throws:
        ServiceException - wrapping any underlying Exceptions
      • setAlgorithm

        public void setAlgorithm​(java.lang.String algorithm)
        Set the name of the secret-key algorithm.

        This value is passed in as one of the parameters to SecretKeySpec(byte[], String); while it is free text, the correct value will depend on what you have agreed with the remote party and support within your JVM.

        Parameters:
        algorithm - the name of the secret-key algorithm to be associated with the given key.
      • getAlgorithm

        public java.lang.String getAlgorithm()
      • setCipherTransformation

        public void setCipherTransformation​(java.lang.String cipherTransformation)
        Set the cipher transformation to be applied

        This value is passed into Cipher.getInstance(String); while it is free text, the correct value will depend on what you have agreed with the remote party and support within your JVM.

        Parameters:
        cipherTransformation - the name of the transformation, e.g. AES/CBC/PKCS5Padding.
      • getCipherTransformation

        public java.lang.String getCipherTransformation()
      • setInitialVector

        public void setInitialVector​(DataInputParameter<java.lang.String> initialVector)
        Set the initial vector for the algorithm

        Depending on the algorithm you have chosen, then size of the initial vector will vary. For instance, for AES, it needs to be 16 bytes

        Parameters:
        initialVector - the Base64 encoded string of initial vector bytes.
      • setKey

        public void setKey​(DataInputParameter<java.lang.String> key)
        Set the initial key the service

        Depending on the algorithm you have chosen, then size of the key will vary. For instance, for AES, it needs to be 32 bytes

        Parameters:
        key - Base64 encoded string of key bytes.
      • setSource

        public void setSource​(MessageWrapper<java.io.InputStream> source)
        Set the source for the input of the crypto service.
        Parameters:
        source - the source.
      • setTarget

        public void setTarget​(MessageWrapper<java.io.OutputStream> target)
        Set the target for the output of the crypto service.
        Parameters:
        target - the target.