Package com.mapr.security
Class JNISecurity
- java.lang.Object
-
- com.mapr.security.JNISecurity
-
public class JNISecurity extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJNISecurity.MutableErr
-
Constructor Summary
Constructors Constructor Description JNISecurity()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidBlacklistAndCloseConnections(int[] uids, long[] blacklistTimes, boolean reinitList)static byte[]CloneAndGenerateTicket(int keyType, byte[] ticketAndKey, long expiryTime, long maxRenewalTimeSec, boolean isExternal, MutableInt err)static byte[]DecodeDataFromKeyFile(byte[] encodedData, JNISecurity.MutableErr err)static byte[]Decrypt(byte[] key, byte[] inBuf, JNISecurity.MutableErr err)static byte[]DecryptTicketInternal(byte[] encryptedTicket, JNISecurity.MutableErr err)static byte[]DecryptTicketInternal2(byte[] encryptedTicket, JNISecurity.MutableErr err, int clientIp)static booleanDoesDareKeyExist()static byte[]EncodeDataForWritingToKeyFile(byte[] serializedProtobuf, JNISecurity.MutableErr err)static byte[]Encrypt(byte[] key, byte[] inBuf, JNISecurity.MutableErr err)static voidGenerateRandomBlock(byte[] buf)static longGenerateRandomNumber()static byte[]GenerateTicketAndKeyInternal(int keyType, java.lang.String userName, int uid, int[] gids, long expiryTime, long maxRenewalTimeSec, boolean isExternal, boolean canUserImpersonate, boolean canUserGenerateTicket, boolean isTenant, int[] ips, int[] impersonatedUids, int[] impersonatedGids, JNISecurity.MutableErr err)static byte[]GenerateTicketAndKeyUsingServerKeyInternal(int keyType, byte[] key, java.lang.String userName, int uid, int[] gids, long expiryTime, long maxRenewalTimeSec, boolean isExternal, JNISecurity.MutableErr err)static intGetCldbHttpsPort(java.lang.String clusterName)static java.lang.StringGetCldbPrincipal(java.lang.String clusterName)static java.lang.StringGetClusterOption(java.lang.String clusterName, java.lang.String key)static intGetDecryptedSize(int cipherTextSize)static intGetEncryptedSize(int plainTextSize)static byte[]GetHash(int hashType, byte[] buf)static byte[]GetKeyFromHSMInternal(boolean isDare, JNISecurity.MutableErr err)static byte[]GetKeyInternal(int keyType, JNISecurity.MutableErr err)static byte[]GetTicketAndKeyForClusterInternal(int keyType, java.lang.String clusterName, JNISecurity.MutableErr err)static java.lang.StringGetUserTicketAndKeyFileLocation()static intInitialize()static booleanIsHSMFeatureEnabled()static booleanIsKerberosEnabled(java.lang.String clusterName)static booleanIsParsingDone()static booleanIsReplayDetectionDisabled(java.lang.String clusterName)static booleanIsSecurityEnabled(java.lang.String clusterName)static intPopulateServerKeyAndTicket(long[] bindings, java.lang.String clusterName)static voidRemoveFromBlacklist(int[] uids)static byte[]RenewTicketAndKeyInternal(int keyType, byte[] ticketAndKey, int[] gids, long expiryTime, JNISecurity.MutableErr err)static intSetClusterOption(java.lang.String clusterName, java.lang.String key, java.lang.String value)static intSetKeyFileInternal(int keyType, java.lang.String path)static intSetKeyInternal(int keyType, byte[] key)static voidSetParsingDone()static intSetTicketAndKeyFileInternal(java.lang.String path)static intSetTicketAndKeyInternal(int keyType, java.lang.String clusterName, byte[] ticketAndKey)static intUseClusterTicketAsServerTicketInternal()
-
-
-
Method Detail
-
GetEncryptedSize
public static int GetEncryptedSize(int plainTextSize)
-
Encrypt
public static byte[] Encrypt(byte[] key, byte[] inBuf, JNISecurity.MutableErr err)
-
GetDecryptedSize
public static int GetDecryptedSize(int cipherTextSize)
-
Decrypt
public static byte[] Decrypt(byte[] key, byte[] inBuf, JNISecurity.MutableErr err)
-
SetKeyFileInternal
public static int SetKeyFileInternal(int keyType, java.lang.String path)
-
GetKeyInternal
public static byte[] GetKeyInternal(int keyType, JNISecurity.MutableErr err)
-
GenerateTicketAndKeyInternal
public static byte[] GenerateTicketAndKeyInternal(int keyType, java.lang.String userName, int uid, int[] gids, long expiryTime, long maxRenewalTimeSec, boolean isExternal, boolean canUserImpersonate, boolean canUserGenerateTicket, boolean isTenant, int[] ips, int[] impersonatedUids, int[] impersonatedGids, JNISecurity.MutableErr err)
-
GenerateTicketAndKeyUsingServerKeyInternal
public static byte[] GenerateTicketAndKeyUsingServerKeyInternal(int keyType, byte[] key, java.lang.String userName, int uid, int[] gids, long expiryTime, long maxRenewalTimeSec, boolean isExternal, JNISecurity.MutableErr err)
-
CloneAndGenerateTicket
public static byte[] CloneAndGenerateTicket(int keyType, byte[] ticketAndKey, long expiryTime, long maxRenewalTimeSec, boolean isExternal, MutableInt err)
-
RenewTicketAndKeyInternal
public static byte[] RenewTicketAndKeyInternal(int keyType, byte[] ticketAndKey, int[] gids, long expiryTime, JNISecurity.MutableErr err)
-
DecryptTicketInternal
public static byte[] DecryptTicketInternal(byte[] encryptedTicket, JNISecurity.MutableErr err)
-
DecryptTicketInternal2
public static byte[] DecryptTicketInternal2(byte[] encryptedTicket, JNISecurity.MutableErr err, int clientIp)
-
SetTicketAndKeyInternal
public static int SetTicketAndKeyInternal(int keyType, java.lang.String clusterName, byte[] ticketAndKey)
-
SetTicketAndKeyFileInternal
public static int SetTicketAndKeyFileInternal(java.lang.String path)
-
UseClusterTicketAsServerTicketInternal
public static int UseClusterTicketAsServerTicketInternal()
-
SetKeyInternal
public static int SetKeyInternal(int keyType, byte[] key)
-
GetTicketAndKeyForClusterInternal
public static byte[] GetTicketAndKeyForClusterInternal(int keyType, java.lang.String clusterName, JNISecurity.MutableErr err)
-
Initialize
public static int Initialize()
-
IsSecurityEnabled
public static boolean IsSecurityEnabled(java.lang.String clusterName)
-
GenerateRandomNumber
public static long GenerateRandomNumber()
-
GenerateRandomBlock
public static void GenerateRandomBlock(byte[] buf)
-
EncodeDataForWritingToKeyFile
public static byte[] EncodeDataForWritingToKeyFile(byte[] serializedProtobuf, JNISecurity.MutableErr err)
-
DecodeDataFromKeyFile
public static byte[] DecodeDataFromKeyFile(byte[] encodedData, JNISecurity.MutableErr err)
-
GetHash
public static byte[] GetHash(int hashType, byte[] buf)
-
GetUserTicketAndKeyFileLocation
public static java.lang.String GetUserTicketAndKeyFileLocation()
-
IsKerberosEnabled
public static boolean IsKerberosEnabled(java.lang.String clusterName)
-
IsReplayDetectionDisabled
public static boolean IsReplayDetectionDisabled(java.lang.String clusterName)
-
GetCldbHttpsPort
public static int GetCldbHttpsPort(java.lang.String clusterName)
-
GetCldbPrincipal
public static java.lang.String GetCldbPrincipal(java.lang.String clusterName)
-
IsParsingDone
public static boolean IsParsingDone()
-
SetParsingDone
public static void SetParsingDone()
-
SetClusterOption
public static int SetClusterOption(java.lang.String clusterName, java.lang.String key, java.lang.String value)
-
GetClusterOption
public static java.lang.String GetClusterOption(java.lang.String clusterName, java.lang.String key)
-
PopulateServerKeyAndTicket
public static int PopulateServerKeyAndTicket(long[] bindings, java.lang.String clusterName)
-
BlacklistAndCloseConnections
public static void BlacklistAndCloseConnections(int[] uids, long[] blacklistTimes, boolean reinitList)
-
RemoveFromBlacklist
public static void RemoveFromBlacklist(int[] uids)
-
IsHSMFeatureEnabled
public static boolean IsHSMFeatureEnabled()
-
DoesDareKeyExist
public static boolean DoesDareKeyExist()
-
GetKeyFromHSMInternal
public static byte[] GetKeyFromHSMInternal(boolean isDare, JNISecurity.MutableErr err)
-
-