// 
// Decompiled by Procyon v0.6.0
// 

package io.sentry.transport;

import org.jetbrains.annotations.Nullable;
import java.net.PasswordAuthentication;
import io.sentry.util.Objects;
import org.jetbrains.annotations.NotNull;
import java.net.Authenticator;

final class ProxyAuthenticator extends Authenticator
{
    @NotNull
    private final String user;
    @NotNull
    private final String password;
    
    ProxyAuthenticator(@NotNull final String user, @NotNull final String password) {
        this.user = Objects.requireNonNull(user, "user is required");
        this.password = Objects.requireNonNull(password, "password is required");
    }
    
    @Nullable
    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        if (this.getRequestorType() == RequestorType.PROXY) {
            return new PasswordAuthentication(this.user, this.password.toCharArray());
        }
        return null;
    }
    
    @NotNull
    String getUser() {
        return this.user;
    }
    
    @NotNull
    String getPassword() {
        return this.password;
    }
}
