mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-11-26 00:52:07 +01:00
Use UTF8Util.UTF8 constant
This commit is contained in:
parent
8eba099146
commit
8aded17f10
4 changed files with 12 additions and 12 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
package sop;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import sop.util.UTF8Util;
|
||||
|
||||
/**
|
||||
* Tuple class bundling a profile name and description.
|
||||
|
@ -77,6 +77,6 @@ public class Profile {
|
|||
*/
|
||||
private static boolean exceeds1000CharLineLimit(Profile profile) {
|
||||
String line = profile.toString();
|
||||
return line.getBytes(Charset.forName("UTF8")).length > 1000;
|
||||
return line.getBytes(UTF8Util.UTF8).length > 1000;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
package sop.operation;
|
||||
|
||||
import sop.exception.SOPGPException;
|
||||
import sop.util.UTF8Util;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
public interface AbstractSign<T> {
|
||||
|
||||
|
@ -67,7 +67,7 @@ public interface AbstractSign<T> {
|
|||
default T withKeyPassword(String password)
|
||||
throws SOPGPException.UnsupportedOption,
|
||||
SOPGPException.PasswordNotHumanReadable {
|
||||
return withKeyPassword(password.getBytes(Charset.forName("UTF8")));
|
||||
return withKeyPassword(password.getBytes(UTF8Util.UTF8));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,11 +8,11 @@ import sop.DecryptionResult;
|
|||
import sop.ReadyWithResult;
|
||||
import sop.SessionKey;
|
||||
import sop.exception.SOPGPException;
|
||||
import sop.util.UTF8Util;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Date;
|
||||
|
||||
public interface Decrypt {
|
||||
|
@ -138,7 +138,7 @@ public interface Decrypt {
|
|||
default Decrypt withKeyPassword(String password)
|
||||
throws SOPGPException.UnsupportedOption,
|
||||
SOPGPException.PasswordNotHumanReadable {
|
||||
return withKeyPassword(password.getBytes(Charset.forName("UTF8")));
|
||||
return withKeyPassword(password.getBytes(UTF8Util.UTF8));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,15 +4,15 @@
|
|||
|
||||
package sop.operation;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import sop.Profile;
|
||||
import sop.Ready;
|
||||
import sop.enums.EncryptAs;
|
||||
import sop.exception.SOPGPException;
|
||||
import sop.util.UTF8Util;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public interface Encrypt {
|
||||
|
||||
|
@ -82,7 +82,7 @@ public interface Encrypt {
|
|||
default Encrypt withKeyPassword(String password)
|
||||
throws SOPGPException.PasswordNotHumanReadable,
|
||||
SOPGPException.UnsupportedOption {
|
||||
return withKeyPassword(password.getBytes(Charset.forName("UTF8")));
|
||||
return withKeyPassword(password.getBytes(UTF8Util.UTF8));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue