Class Tools
java.lang.Object
ecmwf.common.security.Tools
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidecauth(Socket telnetd, OutputStream out, InputStream in, byte[] token, Map<String, String> env) Ecauth.static voidEcauth.static X509CertificateFrom pem.static intGets the unique int id.static longGets the unique long id.static voidlogin(Socket telnetd, OutputStream out, InputStream in, String login, String password, byte[] token, Dimension windowSize, String terminalType, Map<String, String> env) Login.static TelnetWrapperLogin.static voidlogin(Socket telnetd, Socket client, String login, String password, byte[] token, Dimension windowSize, String terminalType, Map<String, String> env) Login.static voidThe main method.static StringnewPassword(int size, int param1, int param2, int param3) New password.static StringnewPassword(String string) New password.static StringtoPEM(X509Certificate certificate) Converts into pem.static X509CertificatetoX509Certificate(byte[] certificate) Converts into x509 certificate.static X509CertificatetoX509Certificate(String certificate) Converts into x509 certificate.
-
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 IOExceptionLogin.- Parameters:
telnetd- the telnetdclient- the clientlogin- the loginpassword- the passwordtoken- the tokenwindowSize- the window sizeterminalType- the terminal typeenv- 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 IOExceptionLogin.- Parameters:
telnetd- the telnetdout- the outin- the inlogin- the loginpassword- the passwordtoken- the tokenwindowSize- the window sizeterminalType- the terminal typeenv- 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 socketlogin- the loginpassword- the passwordtoken- 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 IOExceptionEcauth.- Parameters:
telnetd- the telnetdclient- the clienttoken- the tokenenv- 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 IOExceptionEcauth.- Parameters:
telnetd- the telnetdout- the outin- the intoken- the tokenenv- the env- Throws:
IOException- Signals that an I/O exception has occurred.
-
main
-
newPassword
New password.- Parameters:
size- the sizeparam1- the param1param2- the param2param3- the param3- Returns:
- the string
-
newPassword
-
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
public static X509Certificate fromPEM(String pem) throws IOException, CertificateEncodingException, CertificateException From pem.- Parameters:
pem- the pem- Returns:
- the x509 certificate
- Throws:
IOException- Signals that an I/O exception has occurred.CertificateEncodingException- the certificate encoding exceptionCertificateException- 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
-