Class Security

java.lang.Object
com.mapr.security.Security

public class Security extends Object
  • Field Details

    • MAX_EXPIRY_TIME

      public static long MAX_EXPIRY_TIME
  • Method Details

    • GenerateRandomKey

      public static com.mapr.fs.proto.Security.Key GenerateRandomKey()
    • Encrypt

      public static byte[] Encrypt(com.mapr.fs.proto.Security.Key key, byte[] inBuf, MutableInt erri)
    • Decrypt

      public static byte[] Decrypt(com.mapr.fs.proto.Security.Key key, byte[] inBuf, MutableInt erri)
    • EncodeDataForWritingToKeyFile

      public static byte[] EncodeDataForWritingToKeyFile(byte[] serializedProtobuf, MutableInt erri)
    • DecodeDataFromKeyFile

      public static byte[] DecodeDataFromKeyFile(byte[] encodedData, MutableInt erri)
    • isHSMFeatureEnabled

      public static boolean isHSMFeatureEnabled()
    • doesDareKeyExist

      public static boolean doesDareKeyExist()
    • getCLDBKeyFromHSM

      public static com.mapr.fs.proto.Security.Key getCLDBKeyFromHSM(MutableInt erri)
    • SetKeyFile

      public static int SetKeyFile(com.mapr.fs.proto.Security.ServerKeyType keyType, String path)
    • SetKey

      public static int SetKey(com.mapr.fs.proto.Security.ServerKeyType keyType, com.mapr.fs.proto.Security.Key key)
    • GetKey

      public static com.mapr.fs.proto.Security.Key GetKey(com.mapr.fs.proto.Security.ServerKeyType keyType, MutableInt erri)
    • GenerateTicketAndKey

      public static com.mapr.fs.proto.Security.TicketAndKey GenerateTicketAndKey(com.mapr.fs.proto.Security.ServerKeyType keyType, String userName, int uid, int[] gids, long expiryTime, long maxRenewalTimeSec, TicketOptionalParams tOptionalParams, MutableInt erri)
    • GenerateAndWriteTicketAndKey

      public static void GenerateAndWriteTicketAndKey(String userName, long expiration, DataOutputStream outTicket) throws IOException
      Used by JT to generate a ticket for user for a specific job
      Parameters:
      userName -
      expiration - - will be configurable on JT
      outTicket - - DataOutputStream where ticket will be written
      Throws:
      IOException
    • CloneAndGenerateTicketFile

      public static void CloneAndGenerateTicketFile(DataInputStream fsin, long expiration, DataOutputStream outTicket) throws IOException
      Given an input stream for ticket file, clone the current cluster ticket with given expiration. It generates a non-renewable ticket. Parameters that will be cloned are uid, gids, canImpersonate
      Parameters:
      fsin - - DataInputStream for input ticket
      expiration - - expiration of the cloned ticket.
      outTicket - - DataOutputStream where ticket will be written
      Throws:
      IOException - where input ticket cannot be parsed for current cluster.
    • MergeAndGenerateTicketFile

      public static void MergeAndGenerateTicketFile(DataInputStream fsin, String userName, long expiration, DataOutputStream outTicket) throws IOException
      Throws:
      IOException
    • GenerateTicketAndKeyUsingServerKey

      public static com.mapr.fs.proto.Security.TicketAndKey GenerateTicketAndKeyUsingServerKey(com.mapr.fs.proto.Security.ServerKeyType keyType, com.mapr.fs.proto.Security.Key key, String userName, int uid, int[] gids, long expiryTime, long maxRenewalTimeSec, boolean isExternal, long capabilities, MutableInt erri)
    • RenewTicketAndKey

      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)
    • DecryptTicket

      public static com.mapr.fs.proto.Security.Ticket DecryptTicket(byte[] encryptedTicket, MutableInt erri)
    • SetTicketAndKeyFile

      public static int SetTicketAndKeyFile(String path)
    • SetTicketAndKey

      public static int SetTicketAndKey(com.mapr.fs.proto.Security.ServerKeyType keyType, String clusterName, com.mapr.fs.proto.Security.TicketAndKey ticketAndKey)
    • UseClusterTicketAsServerTicket

      public static void UseClusterTicketAsServerTicket()
    • GetTicketAndKeyForCluster

      public static com.mapr.fs.proto.Security.TicketAndKey GetTicketAndKeyForCluster(com.mapr.fs.proto.Security.ServerKeyType keyType, String clusterName, MutableInt erri)
    • GetServerKey

      public static com.mapr.fs.proto.Security.Key GetServerKey(com.mapr.fs.proto.Security.Key CldbKey, long time)
    • GetClusterKey

      public static com.mapr.fs.proto.Security.Key GetClusterKey(com.mapr.fs.proto.Security.Key CldbKey, long time)
    • ByteArrayToString

      public static String ByteArrayToString(String preFix, byte[] bArray)
    • UserCredsToString

      public static String UserCredsToString(String prefix, com.mapr.fs.proto.Security.CredentialsMsg c)
    • TicketAndKeyToString

      public static String TicketAndKeyToString(String prefix, com.mapr.fs.proto.Security.TicketAndKey t)
    • TicketToString

      public static String TicketToString(String prefix, com.mapr.fs.proto.Security.Ticket t)
    • ValidateTicketAndKey

      public static com.mapr.fs.proto.Security.Ticket ValidateTicketAndKey(com.mapr.fs.proto.Security.TicketAndKey t, MutableInt err)
    • IsTicketAndKeyUsable

      public static boolean IsTicketAndKeyUsable(com.mapr.fs.proto.Security.TicketAndKey ticketAndKey)
    • BlacklistAndCloseConnections

      public static void BlacklistAndCloseConnections(int[] uids, long[] blacklistTimes, boolean reinitList)
    • RemoveFromBlacklist

      public static void RemoveFromBlacklist(int[] uids)
    • TestSecurity

      public static void TestSecurity()
    • main

      public static void main(String[] args)