Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/java/org/spongycastle/crypto/tls/LegacyTlsAuthentication.java')
-rw-r--r--core/src/main/java/org/spongycastle/crypto/tls/LegacyTlsAuthentication.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/core/src/main/java/org/spongycastle/crypto/tls/LegacyTlsAuthentication.java b/core/src/main/java/org/spongycastle/crypto/tls/LegacyTlsAuthentication.java
new file mode 100644
index 00000000..5e8a67ee
--- /dev/null
+++ b/core/src/main/java/org/spongycastle/crypto/tls/LegacyTlsAuthentication.java
@@ -0,0 +1,28 @@
+package org.spongycastle.crypto.tls;
+
+import java.io.IOException;
+
+/**
+ * A temporary class to wrap old CertificateVerifyer stuff for new TlsAuthentication
+ *
+ * @deprecated
+ */
+public class LegacyTlsAuthentication
+ extends ServerOnlyTlsAuthentication
+{
+ protected CertificateVerifyer verifyer;
+
+ public LegacyTlsAuthentication(CertificateVerifyer verifyer)
+ {
+ this.verifyer = verifyer;
+ }
+
+ public void notifyServerCertificate(Certificate serverCertificate)
+ throws IOException
+ {
+ if (!this.verifyer.isValid(serverCertificate.getCertificateList()))
+ {
+ throw new TlsFatalAlert(AlertDescription.user_canceled);
+ }
+ }
+}