001package co.codewizards.cloudstore.rest.client.ssl; 002 003import static co.codewizards.cloudstore.core.util.Util.*; 004 005import java.security.cert.X509Certificate; 006 007public class CheckServerTrustedCertificateExceptionContext { 008 009 private X509Certificate[] certificateChain; 010 private Throwable error; 011 012 protected CheckServerTrustedCertificateExceptionContext(X509Certificate[] certificateChain, Throwable certificateException) { 013 this.certificateChain = assertNotNull("certificateChain", certificateChain); 014 this.error = assertNotNull("error", certificateException); 015 016 if (certificateChain.length < 1) 017 throw new IllegalArgumentException("certificateChain is empty!"); 018 } 019 020 public X509Certificate[] getCertificateChain() { 021 return certificateChain; 022 } 023 024 public Throwable getError() { 025 return error; 026 } 027}