Browse Source

把bouncycastle1.64修改包名后升级原来的1.60

release/10.0
charile_Lu 4 years ago
parent
commit
572fe243de
  1. 22
      fine-bouncycastle/src/main/java/com/fr/third/org/bouncycastle/asn1/DERBoolean.java
  2. 63
      fine-bouncycastle/src/main/java/com/fr/third/org/bouncycastle/crypto/tls/ServerDHParams.java

22
fine-bouncycastle/src/main/java/com/fr/third/org/bouncycastle/asn1/DERBoolean.java

@ -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);
}
}

63
fine-bouncycastle/src/main/java/com/fr/third/org/bouncycastle/crypto/tls/ServerDHParams.java

@ -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))));
}
}
Loading…
Cancel
Save