From 572fe243de6f9bb6d4ce0329e7dbdadbdf2cc868 Mon Sep 17 00:00:00 2001 From: charile_Lu Date: Thu, 23 Jul 2020 20:55:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8Abouncycastle1.64=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8C=85=E5=90=8D=E5=90=8E=E5=8D=87=E7=BA=A7=E5=8E=9F=E6=9D=A5?= =?UTF-8?q?=E7=9A=841.60?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/bouncycastle/asn1/DERBoolean.java | 22 ------- .../crypto/tls/ServerDHParams.java | 63 ------------------- 2 files changed, 85 deletions(-) delete mode 100644 fine-bouncycastle/src/main/java/com/fr/third/org/bouncycastle/asn1/DERBoolean.java delete mode 100644 fine-bouncycastle/src/main/java/com/fr/third/org/bouncycastle/crypto/tls/ServerDHParams.java diff --git a/fine-bouncycastle/src/main/java/com/fr/third/org/bouncycastle/asn1/DERBoolean.java b/fine-bouncycastle/src/main/java/com/fr/third/org/bouncycastle/asn1/DERBoolean.java deleted file mode 100644 index d523af315..000000000 --- a/fine-bouncycastle/src/main/java/com/fr/third/org/bouncycastle/asn1/DERBoolean.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.fr.third.org.bouncycastle.asn1; - -/** - * @deprecated use ASN1Boolean - */ -public class DERBoolean - extends ASN1Boolean -{ - /** - * @deprecated use getInstance(boolean) method. - * @param value - */ - public DERBoolean(boolean value) - { - super(value); - } - - DERBoolean(byte[] value) - { - super(value); - } -} diff --git a/fine-bouncycastle/src/main/java/com/fr/third/org/bouncycastle/crypto/tls/ServerDHParams.java b/fine-bouncycastle/src/main/java/com/fr/third/org/bouncycastle/crypto/tls/ServerDHParams.java deleted file mode 100644 index 7f27a6f19..000000000 --- a/fine-bouncycastle/src/main/java/com/fr/third/org/bouncycastle/crypto/tls/ServerDHParams.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.fr.third.org.bouncycastle.crypto.tls; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.math.BigInteger; - -import com.fr.third.org.bouncycastle.crypto.params.DHParameters; -import com.fr.third.org.bouncycastle.crypto.params.DHPublicKeyParameters; - -public class ServerDHParams -{ - protected DHPublicKeyParameters publicKey; - - public ServerDHParams(DHPublicKeyParameters publicKey) - { - if (publicKey == null) - { - throw new IllegalArgumentException("'publicKey' cannot be null"); - } - - this.publicKey = publicKey; - } - - public DHPublicKeyParameters getPublicKey() - { - return publicKey; - } - - /** - * Encode this {@link ServerDHParams} to an {@link OutputStream}. - * - * @param output - * the {@link OutputStream} to encode to. - * @throws IOException - */ - public void encode(OutputStream output) throws IOException - { - DHParameters dhParameters = publicKey.getParameters(); - BigInteger Ys = publicKey.getY(); - - TlsDHUtils.writeDHParameter(dhParameters.getP(), output); - TlsDHUtils.writeDHParameter(dhParameters.getG(), output); - TlsDHUtils.writeDHParameter(Ys, output); - } - - /** - * Parse a {@link ServerDHParams} from an {@link InputStream}. - * - * @param input - * the {@link InputStream} to parse from. - * @return a {@link ServerDHParams} object. - * @throws IOException - */ - public static ServerDHParams parse(InputStream input) throws IOException - { - BigInteger p = TlsDHUtils.readDHParameter(input); - BigInteger g = TlsDHUtils.readDHParameter(input); - BigInteger Ys = TlsDHUtils.readDHParameter(input); - - return new ServerDHParams(TlsDHUtils.validateDHPublicKey(new DHPublicKeyParameters(Ys, new DHParameters(p, g)))); - } -}