public class TlsECCUtils extends Object
Modifier and Type | Field and Description |
---|---|
static Integer |
EXT_ec_point_formats |
static Integer |
EXT_elliptic_curves |
Constructor and Description |
---|
TlsECCUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addSupportedEllipticCurvesExtension(Hashtable extensions,
int[] namedCurves) |
static void |
addSupportedPointFormatsExtension(Hashtable extensions,
short[] ecPointFormats) |
static boolean |
areOnSameCurve(ECDomainParameters a,
ECDomainParameters b) |
static byte[] |
calculateECDHBasicAgreement(ECPublicKeyParameters publicKey,
ECPrivateKeyParameters privateKey) |
static boolean |
containsECCCipherSuites(int[] cipherSuites) |
static byte[] |
createSupportedEllipticCurvesExtension(int[] namedCurves) |
static byte[] |
createSupportedPointFormatsExtension(short[] ecPointFormats) |
static com.joshvm.java.math.BigInteger |
deserializeECFieldElement(int fieldSize,
byte[] encoding) |
static org.bouncycastle.math.ec.ECPoint |
deserializeECPoint(short[] ecPointFormats,
org.bouncycastle.math.ec.ECCurve curve,
byte[] encoding) |
static ECPublicKeyParameters |
deserializeECPublicKey(short[] ecPointFormats,
ECDomainParameters curve_params,
byte[] encoding) |
static AsymmetricCipherKeyPair |
generateECKeyPair(com.joshvm.java.security.SecureRandom random,
ECDomainParameters ecParams) |
static ECPrivateKeyParameters |
generateEphemeralClientKeyExchange(com.joshvm.java.security.SecureRandom random,
short[] ecPointFormats,
ECDomainParameters ecParams,
OutputStream output) |
static String |
getNameOfNamedCurve(int namedCurve) |
static ECDomainParameters |
getParametersForNamedCurve(int namedCurve) |
static int[] |
getSupportedEllipticCurvesExtension(Hashtable extensions) |
static short[] |
getSupportedPointFormatsExtension(Hashtable extensions) |
static boolean |
hasAnySupportedNamedCurves() |
static boolean |
isCompressionPreferred(short[] ecPointFormats,
short compressionFormat) |
static boolean |
isECCCipherSuite(int cipherSuite) |
static boolean |
isSupportedNamedCurve(int namedCurve) |
static int |
readECExponent(int fieldSize,
InputStream input) |
static com.joshvm.java.math.BigInteger |
readECFieldElement(int fieldSize,
InputStream input) |
static com.joshvm.java.math.BigInteger |
readECParameter(InputStream input) |
static ECDomainParameters |
readECParameters(int[] namedCurves,
short[] ecPointFormats,
InputStream input) |
static int[] |
readSupportedEllipticCurvesExtension(byte[] extensionData) |
static short[] |
readSupportedPointFormatsExtension(byte[] extensionData) |
static byte[] |
serializeECFieldElement(int fieldSize,
com.joshvm.java.math.BigInteger x) |
static byte[] |
serializeECPoint(short[] ecPointFormats,
org.bouncycastle.math.ec.ECPoint point) |
static byte[] |
serializeECPublicKey(short[] ecPointFormats,
ECPublicKeyParameters keyParameters) |
static ECPublicKeyParameters |
validateECPublicKey(ECPublicKeyParameters key) |
static void |
writeECExponent(int k,
OutputStream output) |
static void |
writeECFieldElement(org.bouncycastle.math.ec.ECFieldElement x,
OutputStream output) |
static void |
writeECFieldElement(int fieldSize,
com.joshvm.java.math.BigInteger x,
OutputStream output) |
static void |
writeECParameter(com.joshvm.java.math.BigInteger x,
OutputStream output) |
static void |
writeECPoint(short[] ecPointFormats,
org.bouncycastle.math.ec.ECPoint point,
OutputStream output) |
static void |
writeExplicitECParameters(short[] ecPointFormats,
ECDomainParameters ecParameters,
OutputStream output) |
static void |
writeNamedECParameters(int namedCurve,
OutputStream output) |
public static final Integer EXT_elliptic_curves
public static final Integer EXT_ec_point_formats
public static void addSupportedEllipticCurvesExtension(Hashtable extensions, int[] namedCurves) throws IOException
IOException
public static void addSupportedPointFormatsExtension(Hashtable extensions, short[] ecPointFormats) throws IOException
IOException
public static int[] getSupportedEllipticCurvesExtension(Hashtable extensions) throws IOException
IOException
public static short[] getSupportedPointFormatsExtension(Hashtable extensions) throws IOException
IOException
public static byte[] createSupportedEllipticCurvesExtension(int[] namedCurves) throws IOException
IOException
public static byte[] createSupportedPointFormatsExtension(short[] ecPointFormats) throws IOException
IOException
public static int[] readSupportedEllipticCurvesExtension(byte[] extensionData) throws IOException
IOException
public static short[] readSupportedPointFormatsExtension(byte[] extensionData) throws IOException
IOException
public static String getNameOfNamedCurve(int namedCurve)
public static ECDomainParameters getParametersForNamedCurve(int namedCurve)
public static boolean hasAnySupportedNamedCurves()
public static boolean containsECCCipherSuites(int[] cipherSuites)
public static boolean isECCCipherSuite(int cipherSuite)
public static boolean areOnSameCurve(ECDomainParameters a, ECDomainParameters b)
public static boolean isSupportedNamedCurve(int namedCurve)
public static boolean isCompressionPreferred(short[] ecPointFormats, short compressionFormat)
public static byte[] serializeECFieldElement(int fieldSize, com.joshvm.java.math.BigInteger x) throws IOException
IOException
public static byte[] serializeECPoint(short[] ecPointFormats, org.bouncycastle.math.ec.ECPoint point) throws IOException
IOException
public static byte[] serializeECPublicKey(short[] ecPointFormats, ECPublicKeyParameters keyParameters) throws IOException
IOException
public static com.joshvm.java.math.BigInteger deserializeECFieldElement(int fieldSize, byte[] encoding) throws IOException
IOException
public static org.bouncycastle.math.ec.ECPoint deserializeECPoint(short[] ecPointFormats, org.bouncycastle.math.ec.ECCurve curve, byte[] encoding) throws IOException
IOException
public static ECPublicKeyParameters deserializeECPublicKey(short[] ecPointFormats, ECDomainParameters curve_params, byte[] encoding) throws IOException
IOException
public static byte[] calculateECDHBasicAgreement(ECPublicKeyParameters publicKey, ECPrivateKeyParameters privateKey)
public static AsymmetricCipherKeyPair generateECKeyPair(com.joshvm.java.security.SecureRandom random, ECDomainParameters ecParams)
public static ECPrivateKeyParameters generateEphemeralClientKeyExchange(com.joshvm.java.security.SecureRandom random, short[] ecPointFormats, ECDomainParameters ecParams, OutputStream output) throws IOException
IOException
public static ECPublicKeyParameters validateECPublicKey(ECPublicKeyParameters key) throws IOException
IOException
public static int readECExponent(int fieldSize, InputStream input) throws IOException
IOException
public static com.joshvm.java.math.BigInteger readECFieldElement(int fieldSize, InputStream input) throws IOException
IOException
public static com.joshvm.java.math.BigInteger readECParameter(InputStream input) throws IOException
IOException
public static ECDomainParameters readECParameters(int[] namedCurves, short[] ecPointFormats, InputStream input) throws IOException
IOException
public static void writeECExponent(int k, OutputStream output) throws IOException
IOException
public static void writeECFieldElement(org.bouncycastle.math.ec.ECFieldElement x, OutputStream output) throws IOException
IOException
public static void writeECFieldElement(int fieldSize, com.joshvm.java.math.BigInteger x, OutputStream output) throws IOException
IOException
public static void writeECParameter(com.joshvm.java.math.BigInteger x, OutputStream output) throws IOException
IOException
public static void writeExplicitECParameters(short[] ecPointFormats, ECDomainParameters ecParameters, OutputStream output) throws IOException
IOException
public static void writeECPoint(short[] ecPointFormats, org.bouncycastle.math.ec.ECPoint point, OutputStream output) throws IOException
IOException
public static void writeNamedECParameters(int namedCurve, OutputStream output) throws IOException
IOException