// Path: eid-viewer-lib/src/main/java/be/fedict/eidviewer/lib/X509CertificateChainAndTrust.java
// public class X509CertificateChainAndTrust
// {
//     private List<X509Certificate>           certificates;
//     private List<X509CertificateAndTrust>   certificatesAndTrusts;
//     private String                          trustDomain;
//     private Exception                       validationException;
//     private RevocationValuesType            revocationValues;
//     private List<String>                    invalidReasons;
//     private boolean                         validating, validated,trusted;
// 
//     public X509CertificateChainAndTrust(String trustDomain, List<X509Certificate> certificates)
//     {
//         this.trustDomain=trustDomain;
//         this.certificates=certificates;
//         this.certificatesAndTrusts=new ArrayList<X509CertificateAndTrust>();
//         for(X509Certificate certificate : certificates)
//             this.certificatesAndTrusts.add(new X509CertificateAndTrust(certificate, trustDomain));
//         this.validated = false;
//         this.trusted = false;
//     }
// 
//     public List<X509Certificate> getCertificates()
//     {
//         return certificates;
//     }
// 
//      public List<X509CertificateAndTrust> getCertificatesAndTrusts()
//     {
//         return certificatesAndTrusts;
//     }
// 
//     public Exception getValidationException()
//     {
//         return validationException;
//     }
// 
//     public List<String> getInvalidReasons()
//     {
//         return invalidReasons;
//     }
// 
//     public RevocationValuesType getRevocationValues()
//     {
//         return revocationValues;
//     }
// 
//     public boolean isValidating()
//     {
//         return validating;
//     }
//     
//     public boolean isTrusted()
//     {
//         return trusted;
//     }
// 
//     public boolean isValidated()
//     {
//         return validated;
//     }
//     
//     public String getTrustDomain()
//     {
//         return trustDomain;
//     }
// 
//     /* ------------------------------------------------------------------------------ */
// 
//     public void setValidationException(Exception validationException)
//     {
//         this.validationException = validationException;
//         this.validating=false;
//         this.validated=true;
//         this.trusted=false;
//         propagate();
//     }
// 
//     public void setTrustServiceException(Exception trustServiceException)
//     {
//         this.validationException = trustServiceException;
//         this.validating=false;
//         this.validated=false;
//         this.trusted=false;
//         propagate();
//     }
// 
//     public void setInvalidReasons(List<String> invalidReasons)
//     {
//         this.invalidReasons = invalidReasons;
//         this.validating=false;
//         this.validated=true;
//         this.trusted=false;
//         propagate();
//     }
// 
//     public void setRevocationValues(RevocationValuesType revocationValues)
//     {
//         this.revocationValues=revocationValues;
//         this.validating=false;
//         this.validated=true;
//         this.trusted=false;
//         propagate();
//     }
// 
//     public void setValidating()
//     {
//         this.validating=true;
//         propagate();
//     }
//     
//     public void setTrusted()
//     {
//         this.validating=false;
//         this.validated=true;
//         this.trusted=true;
//         propagate();
//     }
// 
//     private void propagate()
//     {
//         for(X509CertificateAndTrust certificate : certificatesAndTrusts)
//         {
//             certificate.setValidating(this.isValidating());
//             certificate.setValidated(this.isValidated());
//             certificate.setValidationException(this.getValidationException());
//             certificate.setInvalidReasons(this.getInvalidReasons());
//             certificate.setTrusted(this.isTrusted());
//         }
//     }
// 
//     @Override
//     public String toString()
//     {
//         return TextFormatHelper.join(certificatesAndTrusts," signed by ");
//     }
// }


import be.fedict.eidviewer.lib.file.helper.TLVEntry;
import be.fedict.eid.applet.service.Address;
import be.fedict.eid.applet.service.Identity;
import be.fedict.eid.applet.service.impl.tlv.TlvParser;
import be.fedict.eidviewer.lib.EidData;
import be.fedict.eidviewer.lib.X509CertificateChainAndTrust;
import be.fedict.eidviewer.lib.file.helper.TextFormatHelper;
import be.fedict.trust.client.TrustServiceDomains;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
				    authenticationCert = (X509Certificate) certificateFactory
					    .generateCertificate(new ByteArrayInputStream(
						    certEntry2.data));
				    break;

				case 2:
				    signingCert = (X509Certificate) certificateFactory
					    .generateCertificate(new ByteArrayInputStream(
						    certEntry2.data));
				    break;

				case 3:
				    citizenCert = (X509Certificate) certificateFactory
					    .generateCertificate(new ByteArrayInputStream(
						    certEntry2.data));
				    break;

				case 4:
				    rootCert = (X509Certificate) certificateFactory
					    .generateCertificate(new ByteArrayInputStream(
						    certEntry2.data));
				    break;
				}

			    }
				break;
			    }
			}

		    }
// Path: eid-viewer-lib/src/main/java/be/fedict/eidviewer/lib/X509CertificateChainAndTrust.java
// public class X509CertificateChainAndTrust
// {
//     private List<X509Certificate>           certificates;
//     private List<X509CertificateAndTrust>   certificatesAndTrusts;
//     private String                          trustDomain;
//     private Exception                       validationException;
//     private RevocationValuesType            revocationValues;
//     private List<String>                    invalidReasons;
//     private boolean                         validating, validated,trusted;
// 
//     public X509CertificateChainAndTrust(String trustDomain, List<X509Certificate> certificates)
//     {
//         this.trustDomain=trustDomain;
//         this.certificates=certificates;
//         this.certificatesAndTrusts=new ArrayList<X509CertificateAndTrust>();
//         for(X509Certificate certificate : certificates)
//             this.certificatesAndTrusts.add(new X509CertificateAndTrust(certificate, trustDomain));
//         this.validated = false;
//         this.trusted = false;
//     }
// 
//     public List<X509Certificate> getCertificates()
//     {
//         return certificates;
//     }
// 
//      public List<X509CertificateAndTrust> getCertificatesAndTrusts()
//     {
//         return certificatesAndTrusts;
//     }
// 
//     public Exception getValidationException()
//     {
//         return validationException;
//     }
// 
//     public List<String> getInvalidReasons()
//     {
//         return invalidReasons;
//     }
// 
//     public RevocationValuesType getRevocationValues()
//     {
//         return revocationValues;
//     }
// 
//     public boolean isValidating()
//     {
//         return validating;
//     }
//     
//     public boolean isTrusted()
//     {
//         return trusted;
//     }
// 
//     public boolean isValidated()
//     {
//         return validated;
//     }
//     
//     public String getTrustDomain()
//     {
//         return trustDomain;
//     }
// 
//     /* ------------------------------------------------------------------------------ */
// 
//     public void setValidationException(Exception validationException)
//     {
//         this.validationException = validationException;
//         this.validating=false;
//         this.validated=true;
//         this.trusted=false;
//         propagate();
//     }
// 
//     public void setTrustServiceException(Exception trustServiceException)
//     {
//         this.validationException = trustServiceException;
//         this.validating=false;
//         this.validated=false;
//         this.trusted=false;
//         propagate();
//     }
// 
//     public void setInvalidReasons(List<String> invalidReasons)
//     {
//         this.invalidReasons = invalidReasons;
//         this.validating=false;
//         this.validated=true;
//         this.trusted=false;
//         propagate();
//     }
// 
//     public void setRevocationValues(RevocationValuesType revocationValues)
//     {
//         this.revocationValues=revocationValues;
//         this.validating=false;
//         this.validated=true;
//         this.trusted=false;
//         propagate();
//     }
// 
//     public void setValidating()
//     {
//         this.validating=true;
//         propagate();
//     }
//     
//     public void setTrusted()
//     {
//         this.validating=false;
//         this.validated=true;
//         this.trusted=true;
//         propagate();
//     }
// 
//     private void propagate()
//     {
//         for(X509CertificateAndTrust certificate : certificatesAndTrusts)
//         {
//             certificate.setValidating(this.isValidating());
//             certificate.setValidated(this.isValidated());
//             certificate.setValidationException(this.getValidationException());
//             certificate.setInvalidReasons(this.getInvalidReasons());
//             certificate.setTrusted(this.isTrusted());
//         }
//     }
// 
//     @Override
//     public String toString()
//     {
//         return TextFormatHelper.join(certificatesAndTrusts," signed by ");
//     }
// }


// Path: eid-viewer-lib/src/main/java/be/fedict/eidviewer/lib/file/imports/Version35EidFile.java
import be.fedict.eidviewer.lib.file.helper.TLVEntry;
import be.fedict.eid.applet.service.Address;
import be.fedict.eid.applet.service.Identity;
import be.fedict.eid.applet.service.impl.tlv.TlvParser;
import be.fedict.eidviewer.lib.EidData;
import be.fedict.eidviewer.lib.X509CertificateChainAndTrust;
import be.fedict.eidviewer.lib.file.helper.TextFormatHelper;
import be.fedict.trust.client.TrustServiceDomains;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

				    authenticationCert = (X509Certificate) certificateFactory
					    .generateCertificate(new ByteArrayInputStream(
						    certEntry2.data));
				    break;

				case 2:
				    signingCert = (X509Certificate) certificateFactory
					    .generateCertificate(new ByteArrayInputStream(
						    certEntry2.data));
				    break;

				case 3:
				    citizenCert = (X509Certificate) certificateFactory
					    .generateCertificate(new ByteArrayInputStream(
						    certEntry2.data));
				    break;

				case 4:
				    rootCert = (X509Certificate) certificateFactory
					    .generateCertificate(new ByteArrayInputStream(
						    certEntry2.data));
				    break;
				}

			    }
				break;
			    }
			}

		    }
			break;