john 3e62ad946d chore(*): restore from backup
this project was archived and never moved to my new gittea instance, until now
2025-11-24 15:59:13 -07:00

80 lines
1.5 KiB
Java

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);
}
}