mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-23 03:17:58 +01:00
Use StandardCharsets.UTF_8
This commit is contained in:
parent
2e3a435d4e
commit
e9b5e6278a
1 changed files with 3 additions and 2 deletions
|
@ -18,6 +18,7 @@ package org.pgpainless.key;
|
|||
import javax.annotation.Nonnull;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||
|
@ -48,7 +49,7 @@ public class OpenPgpV4Fingerprint implements CharSequence, Comparable<OpenPgpV4F
|
|||
}
|
||||
|
||||
public OpenPgpV4Fingerprint(@Nonnull byte[] bytes) {
|
||||
this(new String(bytes, Charset.forName("UTF-8")));
|
||||
this(new String(bytes, StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
public OpenPgpV4Fingerprint(@Nonnull PGPPublicKey key) {
|
||||
|
@ -87,7 +88,7 @@ public class OpenPgpV4Fingerprint implements CharSequence, Comparable<OpenPgpV4F
|
|||
* @return key id
|
||||
*/
|
||||
public long getKeyId() {
|
||||
byte[] bytes = Hex.decode(toString().getBytes(Charset.forName("UTF-8")));
|
||||
byte[] bytes = Hex.decode(toString().getBytes(StandardCharsets.UTF_8));
|
||||
ByteBuffer buf = ByteBuffer.wrap(bytes);
|
||||
buf.position(12);
|
||||
return buf.getLong();
|
||||
|
|
Loading…
Reference in a new issue