001package org.apache.maven.artifact.repository;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *   http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022public class Authentication
023{
024
025    private String privateKey;
026
027    private String passphrase;
028
029    public Authentication( String userName, String password )
030    {
031        this.username = userName;
032        this.password = password;
033    }
034
035    /**
036     * Username used to login to the host
037     */
038    private String username;
039
040    /**
041     * Password associated with the login
042     */
043    private String password;
044
045    /**
046     * Get the user's password which is used when connecting to the repository.
047     *
048     * @return password of user
049     */
050    public String getPassword()
051    {
052        return password;
053    }
054
055    /**
056     * Set the user's password which is used when connecting to the repository.
057     *
058     * @param password password of the user
059     */
060    public void setPassword( String password )
061    {
062        this.password = password;
063    }
064
065    /**
066     * Get the username used to access the repository.
067     *
068     * @return username at repository
069     */
070    public String getUsername()
071    {
072        return username;
073    }
074
075    /**
076     * Set username used to access the repository.
077     *
078     * @param userName the username used to access repository
079     */
080    public void setUsername( final String userName )
081    {
082        this.username = userName;
083    }
084
085    /**
086     * Get the passphrase of the private key file. The passphrase is used only when host/protocol supports
087     * authentication via exchange of private/public keys and private key was used for authentication.
088     *
089     * @return passphrase of the private key file
090     */
091    public String getPassphrase()
092    {
093        return passphrase;
094    }
095
096    /**
097     * Set the passphrase of the private key file.
098     *
099     * @param passphrase passphrase of the private key file
100     */
101    public void setPassphrase( final String passphrase )
102    {
103        this.passphrase = passphrase;
104    }
105
106    /**
107     * Get the absolute path to the private key file.
108     *
109     * @return absolute path to private key
110     */
111    public String getPrivateKey()
112    {
113        return privateKey;
114    }
115
116    /**
117     * Set the absolute path to private key file.
118     *
119     * @param privateKey path to private key in local file system
120     */
121    public void setPrivateKey( final String privateKey )
122    {
123        this.privateKey = privateKey;
124    }
125
126}