package com.jkgroller.cryptonote.service.to; import org.apache.commons.codec.binary.Hex; import java.nio.charset.StandardCharsets; /** * */ public class EncryptRequestTO { private final String key; private final String unencrypted; /** * @param key * @param unencrypted */ public EncryptRequestTO(String key, String unencrypted) { super(); this.key = key; this.unencrypted = unencrypted; } /** * @param key * @param unencrypted */ public EncryptRequestTO(String key, byte[] unencrypted) { super(); this.key = key; this.unencrypted = Hex.encodeHexString(unencrypted); } /** * * @param key * @param unencrypted */ public EncryptRequestTO(byte[] key, byte[] unencrypted) { super(); this.key = Hex.encodeHexString(key); this.unencrypted = Hex.encodeHexString(unencrypted); } /** * * @param key * @param unencrypted */ public EncryptRequestTO(byte[] key, String unencrypted) { super(); this.key = Hex.encodeHexString(key); this.unencrypted = unencrypted; } /** * @return */ public String getKey() { return key; } /** * @return */ public String getUnencrypted() { return unencrypted; } /** * @return */ public byte[] getUnencryptedBytes() { return unencrypted.getBytes(StandardCharsets.UTF_8); } }