Package net.minecraft.util
Class Crypt
java.lang.Object
net.minecraft.util.Crypt
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static interface
Crypt.ByteArrayToKeyFunction<T extends Key>
static final record
static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
private static final int
private static final String
private static final String
static final Base64.Encoder
static final String
private static final String
private static final String
static final com.mojang.serialization.Codec<PrivateKey>
static final com.mojang.serialization.Codec<PublicKey>
private static final String
static final String
static final String
private static final String
private static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static PrivateKey
byteToPrivateKey
(byte[] p_216083_) static PublicKey
byteToPublicKey
(byte[] p_13601_) private static byte[]
cipherData
(int p_13587_, Key p_13588_, byte[] p_13589_) static SecretKey
decryptByteToSecretKey
(PrivateKey p_13598_, byte[] p_13599_) static byte[]
decryptUsingKey
(Key p_13606_, byte[] p_13607_) private static byte[]
digestData
(byte[]... p_13603_) static byte[]
digestData
(String p_13591_, PublicKey p_13592_, SecretKey p_13593_) static byte[]
encryptUsingKey
(Key p_13595_, byte[] p_13596_) static KeyPair
static SecretKey
static Cipher
static String
pemRsaPrivateKeyToString
(PrivateKey p_216077_) static String
rsaPublicKeyToString
(PublicKey p_216079_) private static <T extends Key>
TrsaStringToKey
(String p_216072_, String p_216073_, String p_216074_, Crypt.ByteArrayToKeyFunction<T> p_216075_) private static Cipher
setupCipher
(int p_13580_, String p_13581_, Key p_13582_) static PrivateKey
stringToPemRsaPrivateKey
(String p_216070_) static PublicKey
stringToRsaPublicKey
(String p_216081_)
-
Field Details
-
SYMMETRIC_ALGORITHM
- See Also:
-
SYMMETRIC_BITS
private static final int SYMMETRIC_BITS- See Also:
-
ASYMMETRIC_ALGORITHM
- See Also:
-
ASYMMETRIC_BITS
private static final int ASYMMETRIC_BITS- See Also:
-
BYTE_ENCODING
- See Also:
-
HASH_ALGORITHM
- See Also:
-
SIGNING_ALGORITHM
- See Also:
-
PEM_RSA_PRIVATE_KEY_HEADER
- See Also:
-
PEM_RSA_PRIVATE_KEY_FOOTER
- See Also:
-
RSA_PUBLIC_KEY_HEADER
- See Also:
-
RSA_PUBLIC_KEY_FOOTER
- See Also:
-
MIME_LINE_SEPARATOR
- See Also:
-
MIME_ENCODER
-
PUBLIC_KEY_CODEC
-
PRIVATE_KEY_CODEC
-
-
Constructor Details
-
Crypt
public Crypt()
-
-
Method Details
-
generateSecretKey
- Throws:
CryptException
-
generateKeyPair
- Throws:
CryptException
-
digestData
public static byte[] digestData(String p_13591_, PublicKey p_13592_, SecretKey p_13593_) throws CryptException - Throws:
CryptException
-
digestData
- Throws:
Exception
-
rsaStringToKey
private static <T extends Key> T rsaStringToKey(String p_216072_, String p_216073_, String p_216074_, Crypt.ByteArrayToKeyFunction<T> p_216075_) throws CryptException - Throws:
CryptException
-
stringToPemRsaPrivateKey
- Throws:
CryptException
-
stringToRsaPublicKey
- Throws:
CryptException
-
rsaPublicKeyToString
-
pemRsaPrivateKeyToString
-
byteToPrivateKey
- Throws:
CryptException
-
byteToPublicKey
- Throws:
CryptException
-
decryptByteToSecretKey
public static SecretKey decryptByteToSecretKey(PrivateKey p_13598_, byte[] p_13599_) throws CryptException - Throws:
CryptException
-
encryptUsingKey
- Throws:
CryptException
-
decryptUsingKey
- Throws:
CryptException
-
cipherData
- Throws:
CryptException
-
setupCipher
- Throws:
Exception
-
getCipher
- Throws:
CryptException
-