Class Tools

java.lang.Object
ecmwf.common.security.Tools

public final class Tools extends Object
The Class Tools.
  • Constructor Details

    • Tools

      public Tools()
  • Method Details

    • login

      public static void login(Socket telnetd, Socket client, String login, String password, byte[] token, Dimension windowSize, String terminalType, Map<String,String> env) throws IOException
      Login.
      Parameters:
      telnetd - the telnetd
      client - the client
      login - the login
      password - the password
      token - the token
      windowSize - the window size
      terminalType - the terminal type
      env - the env
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • login

      public static void login(Socket telnetd, OutputStream out, InputStream in, String login, String password, byte[] token, Dimension windowSize, String terminalType, Map<String,String> env) throws IOException
      Login.
      Parameters:
      telnetd - the telnetd
      out - the out
      in - the in
      login - the login
      password - the password
      token - the token
      windowSize - the window size
      terminalType - the terminal type
      env - the env
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • login

      public static TelnetWrapper login(Socket socket, String login, String password, byte[] token) throws IOException
      Login.
      Parameters:
      socket - the socket
      login - the login
      password - the password
      token - the token
      Returns:
      the telnet wrapper
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • ecauth

      public static void ecauth(Socket telnetd, Socket client, byte[] token, Map<String,String> env) throws IOException
      Ecauth.
      Parameters:
      telnetd - the telnetd
      client - the client
      token - the token
      env - the env
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • ecauth

      public static void ecauth(Socket telnetd, OutputStream out, InputStream in, byte[] token, Map<String,String> env) throws IOException
      Ecauth.
      Parameters:
      telnetd - the telnetd
      out - the out
      in - the in
      token - the token
      env - the env
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • main

      public static void main(String[] args)
      The main method.
      Parameters:
      args - the arguments
    • newPassword

      public static String newPassword(int size, int param1, int param2, int param3)
      New password.
      Parameters:
      size - the size
      param1 - the param1
      param2 - the param2
      param3 - the param3
      Returns:
      the string
    • newPassword

      public static String newPassword(String string)
      New password.
      Parameters:
      string - the string
      Returns:
      the string
    • toX509Certificate

      public static X509Certificate toX509Certificate(byte[] certificate) throws IOException, CertificateException
      Converts into x509 certificate.
      Parameters:
      certificate - the certificate
      Returns:
      the x509 certificate
      Throws:
      IOException - Signals that an I/O exception has occurred.
      CertificateException - the certificate exception
    • toX509Certificate

      public static X509Certificate toX509Certificate(String certificate) throws IOException, CertificateException
      Converts into x509 certificate.
      Parameters:
      certificate - the certificate
      Returns:
      the x509 certificate
      Throws:
      IOException - Signals that an I/O exception has occurred.
      CertificateException - the certificate exception
    • toPEM

      public static String toPEM(X509Certificate certificate) throws IOException, CertificateEncodingException
      Converts into pem.
      Parameters:
      certificate - the certificate
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
      CertificateEncodingException - the certificate encoding exception
    • fromPEM

      From pem.
      Parameters:
      pem - the pem
      Returns:
      the x509 certificate
      Throws:
      IOException - Signals that an I/O exception has occurred.
      CertificateEncodingException - the certificate encoding exception
      CertificateException - the certificate exception
    • getUniqueLongId

      public static long getUniqueLongId()
      Gets the unique long id.
      Returns:
      the unique long id
    • getUniqueIntId

      public static int getUniqueIntId()
      Gets the unique int id.
      Returns:
      the unique int id