public class CryptManager
extends java.lang.Object
コンストラクタと説明 |
---|
CryptManager() |
修飾子とタイプ | メソッドと説明 |
---|---|
static javax.crypto.Cipher |
createNetCipherInstance(int opMode,
java.security.Key key)
Creates an Cipher instance using the AES/CFB8/NoPadding algorithm.
|
static javax.crypto.SecretKey |
createNewSharedKey()
Generate a new shared secret AES key from a secure random source
|
static java.security.PublicKey |
decodePublicKey(byte[] encodedKey)
Create a new PublicKey from encoded X.509 data
|
static byte[] |
decryptData(java.security.Key key,
byte[] data)
Decrypt byte[] data with RSA private key
|
static javax.crypto.SecretKey |
decryptSharedKey(java.security.PrivateKey key,
byte[] secretKeyEncrypted)
Decrypt shared secret AES key using RSA private key
|
static byte[] |
encryptData(java.security.Key key,
byte[] data)
Encrypt byte[] data with RSA public key
|
static java.security.KeyPair |
generateKeyPair()
Generates RSA KeyPair
|
static byte[] |
getServerIdHash(java.lang.String serverId,
java.security.PublicKey publicKey,
javax.crypto.SecretKey secretKey)
Compute a serverId hash for use by sendSessionRequest()
|
public static javax.crypto.SecretKey createNewSharedKey()
public static java.security.KeyPair generateKeyPair()
public static byte[] getServerIdHash(java.lang.String serverId, java.security.PublicKey publicKey, javax.crypto.SecretKey secretKey)
public static java.security.PublicKey decodePublicKey(byte[] encodedKey)
public static javax.crypto.SecretKey decryptSharedKey(java.security.PrivateKey key, byte[] secretKeyEncrypted)
public static byte[] encryptData(java.security.Key key, byte[] data)
public static byte[] decryptData(java.security.Key key, byte[] data)
public static javax.crypto.Cipher createNetCipherInstance(int opMode, java.security.Key key)