aboutsummaryrefslogtreecommitdiff
path: root/src/cz/crcs/ectester/standalone/consts
diff options
context:
space:
mode:
authorJ08nY2018-05-29 17:42:25 +0200
committerJ08nY2018-05-29 17:42:25 +0200
commitd970a9c64a8363a5b6b6fc65c1a767ea6951c298 (patch)
treeec044d8288ad99e791b700b952de727af660fc35 /src/cz/crcs/ectester/standalone/consts
parent298ffc18e590d07eb04d2c5c2b1d553f8fba71bd (diff)
downloadECTester-d970a9c64a8363a5b6b6fc65c1a767ea6951c298.tar.gz
ECTester-d970a9c64a8363a5b6b6fc65c1a767ea6951c298.tar.zst
ECTester-d970a9c64a8363a5b6b6fc65c1a767ea6951c298.zip
Support key algo parameter for KeyAgreements with KDF in standalone testing.
Diffstat (limited to 'src/cz/crcs/ectester/standalone/consts')
-rw-r--r--src/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java b/src/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java
index 0e4d311..6aae423 100644
--- a/src/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java
+++ b/src/cz/crcs/ectester/standalone/consts/KeyAgreementIdent.java
@@ -10,6 +10,8 @@ import java.util.List;
* @author Jan Jancar johny@neuromancer.sk
*/
public class KeyAgreementIdent extends Ident {
+ private boolean requiresKeyAlgo;
+
private static final List<KeyAgreementIdent> ALL = new LinkedList<>();
static {
@@ -18,16 +20,16 @@ public class KeyAgreementIdent extends Ident {
ALL.add(new KeyAgreementIdent("ECDH"));
ALL.add(new KeyAgreementIdent("ECDHC", "ECCDH"));
// ECDH and ECDHC with SHA as KDF, OIDs from RFC 3278
- ALL.add(new KeyAgreementIdent("ECDHwithSHA1KDF", "1.3.133.16.840.63.0.2"));
- ALL.add(new KeyAgreementIdent("ECCDHwithSHA1KDF", "1.3.133.16.840.63.0.3"));
- ALL.add(new KeyAgreementIdent("ECDHwithSHA224KDF", "1.3.132.1.11.0"));
- ALL.add(new KeyAgreementIdent("ECCDHwithSHA224KDF", "1.3.132.1.14.0"));
- ALL.add(new KeyAgreementIdent("ECDHwithSHA256KDF", "1.3.132.1.11.1"));
- ALL.add(new KeyAgreementIdent("ECCDHwithSHA256KDF", "1.3.132.1.14.1"));
- ALL.add(new KeyAgreementIdent("ECDHwithSHA384KDF", "1.3.132.1.11.2"));
- ALL.add(new KeyAgreementIdent("ECCDHwithSHA384KDF", "1.3.132.1.14.2"));
- ALL.add(new KeyAgreementIdent("ECDHwithSHA512KDF", "1.3.132.1.11.3"));
- ALL.add(new KeyAgreementIdent("ECCDHwithSHA512KDF", "1.3.132.1.14.3"));
+ ALL.add(new KeyAgreementIdent("ECDHwithSHA1KDF", true, "1.3.133.16.840.63.0.2"));
+ ALL.add(new KeyAgreementIdent("ECCDHwithSHA1KDF", true, "1.3.133.16.840.63.0.3"));
+ ALL.add(new KeyAgreementIdent("ECDHwithSHA224KDF",true, "1.3.132.1.11.0"));
+ ALL.add(new KeyAgreementIdent("ECCDHwithSHA224KDF", true, "1.3.132.1.14.0"));
+ ALL.add(new KeyAgreementIdent("ECDHwithSHA256KDF", true, "1.3.132.1.11.1"));
+ ALL.add(new KeyAgreementIdent("ECCDHwithSHA256KDF", true, "1.3.132.1.14.1"));
+ ALL.add(new KeyAgreementIdent("ECDHwithSHA384KDF", true, "1.3.132.1.11.2"));
+ ALL.add(new KeyAgreementIdent("ECCDHwithSHA384KDF", true, "1.3.132.1.14.2"));
+ ALL.add(new KeyAgreementIdent("ECDHwithSHA512KDF", true, "1.3.132.1.11.3"));
+ ALL.add(new KeyAgreementIdent("ECCDHwithSHA512KDF", true, "1.3.132.1.14.3"));
// ECMQV - Disable for now as it needs diferent params(too different from DH)
//ALL.add(new KeyAgreementIdent("ECMQV"));
//ALL.add(new KeyAgreementIdent("ECMQVwithSHA1CKDF", "1.3.133.16.840.63.0.16"));
@@ -54,6 +56,15 @@ public class KeyAgreementIdent extends Ident {
super(name, aliases);
}
+ private KeyAgreementIdent(String name, boolean requiresKeyAlgo, String... aliases) {
+ this(name, aliases);
+ this.requiresKeyAlgo = requiresKeyAlgo;
+ }
+
+ public boolean requiresKeyAlgo() {
+ return requiresKeyAlgo;
+ }
+
public KeyAgreement getInstance(Provider provider) throws NoSuchAlgorithmException {
KeyAgreement instance = getInstance((algorithm, provider1) -> {
try {