001package co.codewizards.cloudstore.rest.client.ssl; 002 003import static java.util.Objects.*; 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 = requireNonNull(certificateChain, "certificateChain"); 014 this.error = requireNonNull(certificateException, "error"); 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}