Search in sources :

Example 1 with TlsAuthentication

use of org.openecard.bouncycastle.tls.TlsAuthentication in project open-ecard by ecsec.

the class DefaultTlsClientImpl method getAuthentication.

@Override
public TlsAuthentication getAuthentication() throws IOException {
    return new TlsAuthentication() {

        @Override
        public void notifyServerCertificate(TlsServerCertificate crtfct) throws IOException {
            JavaSecVerifier v = new JavaSecVerifier();
            CertificateVerifier cv = new CertificateVerifierBuilder().and(new HostnameVerifier()).and(v).and(new KeyLengthVerifier()).build();
            cv.isValid(crtfct, serverNames.get(0).toString());
        }

        @Override
        public TlsCredentials getClientCredentials(CertificateRequest cr) throws IOException {
            throw new UnsupportedOperationException("Not supported yet.");
        }
    };
}
Also used : TlsServerCertificate(org.openecard.bouncycastle.tls.TlsServerCertificate) TlsAuthentication(org.openecard.bouncycastle.tls.TlsAuthentication) CertificateVerifier(org.openecard.crypto.tls.CertificateVerifier) CertificateRequest(org.openecard.bouncycastle.tls.CertificateRequest)

Aggregations

CertificateRequest (org.openecard.bouncycastle.tls.CertificateRequest)1 TlsAuthentication (org.openecard.bouncycastle.tls.TlsAuthentication)1 TlsServerCertificate (org.openecard.bouncycastle.tls.TlsServerCertificate)1 CertificateVerifier (org.openecard.crypto.tls.CertificateVerifier)1