Class EncryptDecrypt

    • Constructor Detail

      • EncryptDecrypt

        public EncryptDecrypt()
    • Method Detail

      • withEncryptionAlgorithm

        public <T extends EncryptDecrypt> T withEncryptionAlgorithm​(java.lang.String s)
      • encryptionContext

        protected java.util.Map<java.lang.String,​java.lang.String> encryptionContext()
      • encryptionAlgorithm

        protected java.lang.String encryptionAlgorithm​(AdaptrisMessage msg)
      • writeOutput

        protected void writeOutput​(java.nio.ByteBuffer data,
                                   AdaptrisMessage msg)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • toByteBuffer

        protected java.nio.ByteBuffer toByteBuffer​(AdaptrisMessage msg)
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getInput

        public MessageWrapper<byte[]> getInput()
        Specify the source for the encrypt/decrypt operation.

        Since KMS encrypt/decrypt API uses ByteBuffer we use a MessageWrapper that wraps a byte array; this will mean that the entire contents of the message payload will ultimately be resident in memory.

      • setInput

        public void setInput​(MessageWrapper<byte[]> input)
        Specify the source for the encrypt/decrypt operation.

        Since KMS encrypt/decrypt API uses ByteBuffer we use a MessageWrapper that wraps a byte array; this will mean that the entire contents of the message payload will ultimately be resident in memory.

      • getOutput

        public MessageWrapper<java.io.OutputStream> getOutput()
        Specify the message type for this operation.

        Since KMS encrypt/decrypt API uses ByteBuffer we use a MessageWrapper that wraps an Outputstream

      • setOutput

        public void setOutput​(MessageWrapper<java.io.OutputStream> output)
        Specify the message type for this operation.

        Since KMS encrypt/decrypt API uses ByteBuffer we use a MessageWrapper that wraps an Outputstream

      • getEncryptionContext

        public KeyValuePairSet getEncryptionContext()
        Specify an encryption context values that you want to use.
      • setEncryptionContext

        public void setEncryptionContext​(KeyValuePairSet encryptionContext)
        Specify an encryption context values that you want to use.
      • getEncryptionAlgorithm

        public java.lang.String getEncryptionAlgorithm()
        Specify the encryption algorithm to use for this operation.

        No validation is done on the value; if this is not set then behaviour will largely be dependent on the key in question, if it is a symmetric key then SYMMETRIC_DEFAULT will be used, if it is an asymmetric CMK then it's likely be an exception.

      • setEncryptionAlgorithm

        public void setEncryptionAlgorithm​(java.lang.String encryptionAlgorithm)
        Specify the encryption algorithm to use for this operation.

        No validation is done on the value; if this is not set then behaviour will largely be dependent on the key in question, if it is a symmetric key then SYMMETRIC_DEFAULT will be used, if it is an asymmetric CMK then it's likely be an exception.