Source Code Cross Referenced for SVNSSHAuthentication.java in  » Source-Control » tmatesoft-SVN » org » tmatesoft » svn » core » auth » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Source Control » tmatesoft SVN » org.tmatesoft.svn.core.auth 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ====================================================================
003:         * Copyright (c) 2004-2008 TMate Software Ltd.  All rights reserved.
004:         *
005:         * This software is licensed as described in the file COPYING, which
006:         * you should have received as part of this distribution.  The terms
007:         * are also available at http://svnkit.com/license.html
008:         * If newer versions of this license are posted there, you may use a
009:         * newer version instead, at your option.
010:         * ====================================================================
011:         */
012:        package org.tmatesoft.svn.core.auth;
013:
014:        import java.io.File;
015:
016:        /**
017:         * The <b>SVNSSHAuthentication</b> class represents a kind of credentials used 
018:         * to authenticate a user over an SSH tunnel.
019:         * 
020:         * <p> 
021:         * To obtain an ssh user credential, specify the {@link ISVNAuthenticationManager#SSH SSH} 
022:         * kind to credentials getter method of <b>ISVNAuthenticationManager</b>: 
023:         * {@link ISVNAuthenticationManager#getFirstAuthentication(String, String, SVNURL) getFirstAuthentication()}, 
024:         * {@link ISVNAuthenticationManager#getNextAuthentication(String, String, SVNURL) getNextAuthentication()}.
025:         * 
026:         * @version 1.1.1
027:         * @author  TMate Software Ltd.
028:         * @see     ISVNAuthenticationManager  
029:         */
030:        public class SVNSSHAuthentication extends SVNAuthentication {
031:
032:            private String myPassword;
033:            private String myPassphrase;
034:            private File myPrivateKeyFile;
035:            private int myPortNumber;
036:            private char[] myPrivateKeyValue;
037:
038:            /**
039:             * Creates a user credential object for authenticating over an ssh tunnel. 
040:             * This kind of credentials is used when an ssh connection requires 
041:             * a user password instead of an ssh private key.
042:             * 
043:             * @param userName         the name of a user to authenticate 
044:             * @param password         the user's password
045:             * @param portNumber       the number of a port to establish an ssh tunnel over  
046:             * @param storageAllowed   if <span class="javakeyword">true</span> then
047:             *                         this credential is allowed to be stored in the 
048:             *                         global auth cache, otherwise not
049:             */
050:            public SVNSSHAuthentication(String userName, String password,
051:                    int portNumber, boolean storageAllowed) {
052:                super (ISVNAuthenticationManager.SSH, userName, storageAllowed);
053:                myPassword = password;
054:                myPortNumber = portNumber;
055:            }
056:
057:            /**
058:             * Creates a user credential object for authenticating over an ssh tunnel. 
059:             * This kind of credentials is used when an ssh connection requires 
060:             * an ssh private key.
061:             * 
062:             * @param userName         the name of a user to authenticate 
063:             * @param keyFile          the user's ssh private key file 
064:             * @param passphrase       a password to the ssh private key
065:             * @param portNumber       the number of a port to establish an ssh tunnel over  
066:             * @param storageAllowed   if <span class="javakeyword">true</span> then
067:             *                         this credential is allowed to be stored in the 
068:             *                         global auth cache, otherwise not
069:             */
070:            public SVNSSHAuthentication(String userName, File keyFile,
071:                    String passphrase, int portNumber, boolean storageAllowed) {
072:                super (ISVNAuthenticationManager.SSH, userName, storageAllowed);
073:                myPrivateKeyFile = keyFile;
074:                myPassphrase = passphrase;
075:                myPortNumber = portNumber;
076:            }
077:
078:            /**
079:             * Creates a user credential object for authenticating over an ssh tunnel. 
080:             * This kind of credentials is used when an ssh connection requires 
081:             * an ssh private key.
082:             * 
083:             * @param userName         the name of a user to authenticate 
084:             * @param privateKey       the user's ssh private key 
085:             * @param passphrase       a password to the ssh private key
086:             * @param portNumber       the number of a port to establish an ssh tunnel over  
087:             * @param storageAllowed   if <span class="javakeyword">true</span> then
088:             *                         this credential is allowed to be stored in the 
089:             *                         global auth cache, otherwise not
090:             */
091:            public SVNSSHAuthentication(String userName, char[] privateKey,
092:                    String passphrase, int portNumber, boolean storageAllowed) {
093:                super (ISVNAuthenticationManager.SSH, userName, storageAllowed);
094:                myPrivateKeyValue = privateKey;
095:                myPassphrase = passphrase;
096:                myPortNumber = portNumber;
097:            }
098:
099:            /**
100:             * Returns the user account's password. This is used when an  
101:             * ssh private key is not used. 
102:             * 
103:             * @return the user's password
104:             */
105:            public String getPassword() {
106:                return myPassword;
107:            }
108:
109:            /**
110:             * Returns the password to the ssh private key. 
111:             * 
112:             * @return the password to the private key
113:             * @see    #getPrivateKeyFile()
114:             */
115:            public String getPassphrase() {
116:                return myPassphrase;
117:            }
118:
119:            /**
120:             * Returns the File representation referring to the file with the 
121:             * user's ssh private key. If the private key is encrypted with a 
122:             * passphrase, it should have been provided to an appropriate constructor.
123:             * 
124:             * @return the user's private key file
125:             */
126:            public File getPrivateKeyFile() {
127:                return myPrivateKeyFile;
128:            }
129:
130:            /**
131:             * Returns ssh private key. If the private key is encrypted with a 
132:             * passphrase, it should have been provided to an appropriate constructor.
133:             * 
134:             * @return the user's private key file
135:             */
136:            public char[] getPrivateKey() {
137:                return myPrivateKeyValue;
138:            }
139:
140:            /**
141:             * Returns the number of the port across which an ssh tunnel 
142:             * is established. 
143:             * 
144:             * @return the port number to establish an ssh tunnel over
145:             */
146:            public int getPortNumber() {
147:                return myPortNumber;
148:            }
149:
150:            public boolean hasPrivateKey() {
151:                return myPrivateKeyFile != null || myPrivateKeyValue != null;
152:            }
153:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.