public class Security
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static long |
MAX_EXPIRY_TIME |
| Modifier and Type | Method and Description |
|---|---|
static void |
BlacklistAndCloseConnections(int[] uids,
long[] blacklistTimes,
boolean reinitList) |
static java.lang.String |
ByteArrayToString(java.lang.String preFix,
byte[] bArray) |
static void |
CloneAndGenerateTicketFile(java.io.DataInputStream fsin,
long expiration,
java.io.DataOutputStream outTicket)
Given an input stream for ticket file, clone the current cluster
ticket with given expiration.
|
static byte[] |
DecodeDataFromKeyFile(byte[] encodedData,
MutableInt erri) |
static byte[] |
Decrypt(com.mapr.fs.proto.Security.Key key,
byte[] inBuf,
MutableInt erri) |
static com.mapr.fs.proto.Security.Ticket |
DecryptTicket(byte[] encryptedTicket,
MutableInt erri) |
static byte[] |
EncodeDataForWritingToKeyFile(byte[] serializedProtobuf,
MutableInt erri) |
static byte[] |
Encrypt(com.mapr.fs.proto.Security.Key key,
byte[] inBuf,
MutableInt erri) |
static void |
GenerateAndWriteTicketAndKey(java.lang.String userName,
long expiration,
java.io.DataOutputStream outTicket)
Used by JT to generate a ticket for user for a specific job
|
static com.mapr.fs.proto.Security.Key |
GenerateRandomKey() |
static com.mapr.fs.proto.Security.TicketAndKey |
GenerateTicketAndKey(com.mapr.fs.proto.Security.ServerKeyType keyType,
java.lang.String userName,
int uid,
int[] gids,
long expiryTime,
long maxRenewalTimeSec,
boolean isExternal,
boolean canUserImpersonate,
int[] ips,
MutableInt erri) |
static com.mapr.fs.proto.Security.TicketAndKey |
GenerateTicketAndKeyUsingServerKey(com.mapr.fs.proto.Security.ServerKeyType keyType,
com.mapr.fs.proto.Security.Key key,
java.lang.String userName,
int uid,
int[] gids,
long expiryTime,
long maxRenewalTimeSec,
boolean isExternal,
MutableInt erri) |
static com.mapr.fs.proto.Security.Key |
GetClusterKey(com.mapr.fs.proto.Security.Key CldbKey,
long time) |
static com.mapr.fs.proto.Security.Key |
GetKey(com.mapr.fs.proto.Security.ServerKeyType keyType,
MutableInt erri) |
static com.mapr.fs.proto.Security.Key |
GetServerKey(com.mapr.fs.proto.Security.Key CldbKey,
long time) |
static com.mapr.fs.proto.Security.TicketAndKey |
GetTicketAndKeyForCluster(com.mapr.fs.proto.Security.ServerKeyType keyType,
java.lang.String clusterName,
MutableInt erri) |
static boolean |
IsTicketAndKeyUsable(com.mapr.fs.proto.Security.TicketAndKey ticketAndKey) |
static void |
main(java.lang.String[] args) |
static void |
MergeAndGenerateTicketFile(java.io.DataInputStream fsin,
java.lang.String userName,
long expiration,
java.io.DataOutputStream outTicket) |
static void |
RemoveFromBlacklist(int[] uids) |
static com.mapr.fs.proto.Security.TicketAndKey |
RenewTicketAndKey(com.mapr.fs.proto.Security.ServerKeyType keyType,
com.mapr.fs.proto.Security.TicketAndKey ticketAndKey,
long expiryTime,
MutableInt erri) |
static int |
SetKey(com.mapr.fs.proto.Security.ServerKeyType keyType,
com.mapr.fs.proto.Security.Key key) |
static int |
SetKeyFile(com.mapr.fs.proto.Security.ServerKeyType keyType,
java.lang.String path) |
static int |
SetTicketAndKey(com.mapr.fs.proto.Security.ServerKeyType keyType,
java.lang.String clusterName,
com.mapr.fs.proto.Security.TicketAndKey ticketAndKey) |
static int |
SetTicketAndKeyFile(java.lang.String path) |
static void |
TestSecurity() |
static java.lang.String |
TicketAndKeyToString(java.lang.String prefix,
com.mapr.fs.proto.Security.TicketAndKey t) |
static java.lang.String |
TicketToString(java.lang.String prefix,
com.mapr.fs.proto.Security.Ticket t) |
static void |
UseClusterTicketAsServerTicket() |
static java.lang.String |
UserCredsToString(java.lang.String prefix,
com.mapr.fs.proto.Security.CredentialsMsg c) |
static com.mapr.fs.proto.Security.Ticket |
ValidateTicketAndKey(com.mapr.fs.proto.Security.TicketAndKey t,
MutableInt err) |
public static com.mapr.fs.proto.Security.Key GenerateRandomKey()
public static byte[] Encrypt(com.mapr.fs.proto.Security.Key key,
byte[] inBuf,
MutableInt erri)
public static byte[] Decrypt(com.mapr.fs.proto.Security.Key key,
byte[] inBuf,
MutableInt erri)
public static byte[] EncodeDataForWritingToKeyFile(byte[] serializedProtobuf,
MutableInt erri)
public static byte[] DecodeDataFromKeyFile(byte[] encodedData,
MutableInt erri)
public static int SetKeyFile(com.mapr.fs.proto.Security.ServerKeyType keyType,
java.lang.String path)
public static int SetKey(com.mapr.fs.proto.Security.ServerKeyType keyType,
com.mapr.fs.proto.Security.Key key)
public static com.mapr.fs.proto.Security.Key GetKey(com.mapr.fs.proto.Security.ServerKeyType keyType,
MutableInt erri)
public static com.mapr.fs.proto.Security.TicketAndKey GenerateTicketAndKey(com.mapr.fs.proto.Security.ServerKeyType keyType,
java.lang.String userName,
int uid,
int[] gids,
long expiryTime,
long maxRenewalTimeSec,
boolean isExternal,
boolean canUserImpersonate,
int[] ips,
MutableInt erri)
public static void GenerateAndWriteTicketAndKey(java.lang.String userName,
long expiration,
java.io.DataOutputStream outTicket)
throws java.io.IOException
userName - expiration - - will be configurable on JToutTicket - - DataOutputStream where ticket will be writtenjava.io.IOExceptionpublic static void CloneAndGenerateTicketFile(java.io.DataInputStream fsin,
long expiration,
java.io.DataOutputStream outTicket)
throws java.io.IOException
fsin - - DataInputStream for input ticketexpiration - - expiration of the cloned ticket.outTicket - - DataOutputStream where ticket will be writtenjava.io.IOException - where input ticket cannot be parsed
for current cluster.public static void MergeAndGenerateTicketFile(java.io.DataInputStream fsin,
java.lang.String userName,
long expiration,
java.io.DataOutputStream outTicket)
throws java.io.IOException
java.io.IOExceptionpublic static com.mapr.fs.proto.Security.TicketAndKey GenerateTicketAndKeyUsingServerKey(com.mapr.fs.proto.Security.ServerKeyType keyType,
com.mapr.fs.proto.Security.Key key,
java.lang.String userName,
int uid,
int[] gids,
long expiryTime,
long maxRenewalTimeSec,
boolean isExternal,
MutableInt erri)
public static com.mapr.fs.proto.Security.TicketAndKey RenewTicketAndKey(com.mapr.fs.proto.Security.ServerKeyType keyType,
com.mapr.fs.proto.Security.TicketAndKey ticketAndKey,
long expiryTime,
MutableInt erri)
public static com.mapr.fs.proto.Security.Ticket DecryptTicket(byte[] encryptedTicket,
MutableInt erri)
public static int SetTicketAndKeyFile(java.lang.String path)
public static int SetTicketAndKey(com.mapr.fs.proto.Security.ServerKeyType keyType,
java.lang.String clusterName,
com.mapr.fs.proto.Security.TicketAndKey ticketAndKey)
public static void UseClusterTicketAsServerTicket()
public static com.mapr.fs.proto.Security.TicketAndKey GetTicketAndKeyForCluster(com.mapr.fs.proto.Security.ServerKeyType keyType,
java.lang.String clusterName,
MutableInt erri)
public static com.mapr.fs.proto.Security.Key GetServerKey(com.mapr.fs.proto.Security.Key CldbKey,
long time)
public static com.mapr.fs.proto.Security.Key GetClusterKey(com.mapr.fs.proto.Security.Key CldbKey,
long time)
public static java.lang.String ByteArrayToString(java.lang.String preFix,
byte[] bArray)
public static java.lang.String UserCredsToString(java.lang.String prefix,
com.mapr.fs.proto.Security.CredentialsMsg c)
public static java.lang.String TicketAndKeyToString(java.lang.String prefix,
com.mapr.fs.proto.Security.TicketAndKey t)
public static java.lang.String TicketToString(java.lang.String prefix,
com.mapr.fs.proto.Security.Ticket t)
public static com.mapr.fs.proto.Security.Ticket ValidateTicketAndKey(com.mapr.fs.proto.Security.TicketAndKey t,
MutableInt err)
public static boolean IsTicketAndKeyUsable(com.mapr.fs.proto.Security.TicketAndKey ticketAndKey)
public static void BlacklistAndCloseConnections(int[] uids,
long[] blacklistTimes,
boolean reinitList)
public static void RemoveFromBlacklist(int[] uids)
public static void TestSecurity()
public static void main(java.lang.String[] args)