// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/PINPurpose.java
// public enum PINPurpose {
// 	PINTest("test"),
// 	AuthenticationSignature("authentication"),
// 	NonRepudiationSignature("nonrepudiation");
// 
// 	private final String type;
// 
// 	PINPurpose(final String type) {
// 		this.type = type;
// 	}
// 
// 	public String getType() {
// 		return this.type;
// 	}
// 
// 	/**
// 	 * Determine the likely reason for a PIN request by checking the certificate
// 	 * chain involved.
// 	 *
// 	 * @param fileType the File on the BeID that is involved in the operation
// 	 * @return the PIN Purpose associated with this type of file
// 	 */
// 	public static PINPurpose fromFileType(final FileType fileType) {
// 		switch (fileType) {
// 			case AuthentificationCertificate:
// 				return AuthenticationSignature;
// 			case NonRepudiationCertificate:
// 				return NonRepudiationSignature;
// 			default:
// 				return PINTest;
// 		}
// 	}
// }


import java.util.Locale;
import be.bosa.commons.eid.client.PINPurpose;
/*
 * Commons eID Project.
 * Copyright (C) 2012-2013 FedICT.
 * Copyright (C) 2014 e-Contract.be BVBA.
 * Copyright (C) 2014 - 2018 BOSA.
 *
 * This is free software; you can redistribute it and/or modify it under the
 * terms of the GNU Lesser General Public License version 3.0 as published by
 * the Free Software Foundation.
 *
 * This software is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this software; if not, see https://www.gnu.org/licenses/.
 */

package be.bosa.commons.eid.client.spi;



/**
 * An adapter implementing BeIDCardUI with empty default actions. Intended to be
 * extended by a useful class overriding only those methods it requires. For
 * example, in an embedded application having only a secure PINPAD reader, none
 * of the obtain() methods would ever be called.
 *
 * @author Frank Marien
 */
public class BeIDCardUIAdapter implements BeIDCardUI {

	private static final String OPERATION_CANCELLED = "operation cancelled.";
	protected Locale locale;

	@Override
// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/PINPurpose.java
// public enum PINPurpose {
// 	PINTest("test"),
// 	AuthenticationSignature("authentication"),
// 	NonRepudiationSignature("nonrepudiation");
// 
// 	private final String type;
// 
// 	PINPurpose(final String type) {
// 		this.type = type;
// 	}
// 
// 	public String getType() {
// 		return this.type;
// 	}
// 
// 	/**
// 	 * Determine the likely reason for a PIN request by checking the certificate
// 	 * chain involved.
// 	 *
// 	 * @param fileType the File on the BeID that is involved in the operation
// 	 * @return the PIN Purpose associated with this type of file
// 	 */
// 	public static PINPurpose fromFileType(final FileType fileType) {
// 		switch (fileType) {
// 			case AuthentificationCertificate:
// 				return AuthenticationSignature;
// 			case NonRepudiationCertificate:
// 				return NonRepudiationSignature;
// 			default:
// 				return PINTest;
// 		}
// 	}
// }


// Path: commons-eid-client/src/main/java/be/bosa/commons/eid/client/spi/BeIDCardUIAdapter.java
import java.util.Locale;
import be.bosa.commons.eid.client.PINPurpose;

/*
 * Commons eID Project.
 * Copyright (C) 2012-2013 FedICT.
 * Copyright (C) 2014 e-Contract.be BVBA.
 * Copyright (C) 2014 - 2018 BOSA.
 *
 * This is free software; you can redistribute it and/or modify it under the
 * terms of the GNU Lesser General Public License version 3.0 as published by
 * the Free Software Foundation.
 *
 * This software is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this software; if not, see https://www.gnu.org/licenses/.
 */

package be.bosa.commons.eid.client.spi;



/**
 * An adapter implementing BeIDCardUI with empty default actions. Intended to be
 * extended by a useful class overriding only those methods it requires. For
 * example, in an embedded application having only a secure PINPAD reader, none
 * of the obtain() methods would ever be called.
 *
 * @author Frank Marien
 */
public class BeIDCardUIAdapter implements BeIDCardUI {

	private static final String OPERATION_CANCELLED = "operation cancelled.";
	protected Locale locale;

	@Override
	public char[] obtainPIN(final int triesLeft, final PINPurpose type) {