001/* 002 * Copyright 2024 Björn Kautler 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package net.jsign.jca; 018 019import java.security.KeyStore; 020 021import net.jsign.KeyStoreBuilder; 022 023/** 024 * Credentials for the Keyfactor SignServer REST API. 025 * 026 * @since 7.0 027 */ 028public class SignServerCredentials { 029 030 public final String username; 031 public final String password; 032 public final KeyStore.Builder keystore; 033 034 public SignServerCredentials(String username, String password, String keystore, String storepass) { 035 this(username, password, keystore == null ? null : new KeyStoreBuilder().keystore(keystore).storepass(storepass).builder()); 036 } 037 038 public SignServerCredentials(String username, String password, KeyStore.Builder keystore) { 039 this.username = username; 040 this.password = password; 041 this.keystore = keystore; 042 } 043}