Properly format session keys for --session-key-out

This commit is contained in:
Paul Schaub 2022-11-06 20:22:40 +01:00
parent 40919be3f7
commit dd5d790e21
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -18,6 +18,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.nio.charset.Charset;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -137,7 +138,8 @@ public class DecryptCmd extends AbstractSopCmd {
} else { } else {
SessionKey sessionKey = result.getSessionKey().get(); SessionKey sessionKey = result.getSessionKey().get();
outputStream.write(sessionKey.getAlgorithm()); outputStream.write(sessionKey.getAlgorithm());
outputStream.write(sessionKey.getKey()); // noinspection CharsetObjectCanBeUsed
outputStream.write(sessionKey.toString().getBytes(Charset.forName("UTF8")));
} }
} }
} }