@Override public Principal getPeerPrincipal() throws SSLPeerUnverifiedException { checkPeerCertificatesPresent(); return peerCertificates[0].getSubjectX500Principal(); }
@Override public Principal getPeerPrincipal() throws SSLPeerUnverifiedException { checkPeerCertificatesPresent(); return peerCertificates[0].getSubjectX500Principal(); }
@Override public X509Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException { checkPeerCertificatesPresent(); return peerCertificates.clone(); }
@Override public X509Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException { checkPeerCertificatesPresent(); return peerCertificates.clone(); }
/** * Returns the certificate(s) of the peer in this SSL session * used in the handshaking phase of the connection. * Please notice hat this method is superseded by * <code>getPeerCertificates()</code>. * @return an array of X509 certificates (the peer's one first and then * eventually that of the certification authority) or null if no * certificate were used during the SSL connection. * @throws SSLPeerUnverifiedException if either a non-X.509 certificate * was used (i.e. Kerberos certificates) or the peer could not * be verified. */ @Override public javax.security.cert.X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException { checkPeerCertificatesPresent(); // TODO(nathanmittler): Should we clone? javax.security.cert.X509Certificate[] result = peerCertificateChain; if (result == null) { // single-check idiom peerCertificateChain = result = SSLUtils.toCertificateChain(peerCertificates); } return result; }
/** * Returns the certificate(s) of the peer in this SSL session * used in the handshaking phase of the connection. * Please notice hat this method is superseded by * <code>getPeerCertificates()</code>. * @return an array of X509 certificates (the peer's one first and then * eventually that of the certification authority) or null if no * certificate were used during the SSL connection. * @throws SSLPeerUnverifiedException if either a non-X.509 certificate * was used (i.e. Kerberos certificates) or the peer could not * be verified. */ @Override public javax.security.cert.X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException { checkPeerCertificatesPresent(); // TODO(nathanmittler): Should we clone? javax.security.cert.X509Certificate[] result = peerCertificateChain; if (result == null) { // single-check idiom peerCertificateChain = result = SSLUtils.toCertificateChain(peerCertificates); } return result; }