From 6723a12712836cae4908f2918e88a3db9b12fe1c Mon Sep 17 00:00:00 2001 From: Aviv Palivoda Date: Tue, 7 Feb 2017 15:24:56 +0200 Subject: DH serialization (#3297) * DH keys support serialization * Add DH serialization documentation * Add tests for DH keys serialization in DER encoding * update version to 1.8 * Allow only SubjectPublicKeyInfo serialization * Remove support in TraditionalOpenSSL format * Fix pep8 * Refactor dh serialization tests --- vectors/cryptography_vectors/asymmetric/DH/dhkey.der | Bin 0 -> 293 bytes vectors/cryptography_vectors/asymmetric/DH/dhkey.pem | 9 +++++++++ vectors/cryptography_vectors/asymmetric/DH/dhkey.txt | 6 ++++++ vectors/cryptography_vectors/asymmetric/DH/dhp.der | Bin 0 -> 138 bytes vectors/cryptography_vectors/asymmetric/DH/dhp.pem | 5 +++++ vectors/cryptography_vectors/asymmetric/DH/dhpub.der | Bin 0 -> 292 bytes vectors/cryptography_vectors/asymmetric/DH/dhpub.pem | 9 +++++++++ 7 files changed, 29 insertions(+) create mode 100644 vectors/cryptography_vectors/asymmetric/DH/dhkey.der create mode 100644 vectors/cryptography_vectors/asymmetric/DH/dhkey.pem create mode 100644 vectors/cryptography_vectors/asymmetric/DH/dhkey.txt create mode 100644 vectors/cryptography_vectors/asymmetric/DH/dhp.der create mode 100644 vectors/cryptography_vectors/asymmetric/DH/dhp.pem create mode 100644 vectors/cryptography_vectors/asymmetric/DH/dhpub.der create mode 100644 vectors/cryptography_vectors/asymmetric/DH/dhpub.pem (limited to 'vectors/cryptography_vectors/asymmetric/DH') diff --git a/vectors/cryptography_vectors/asymmetric/DH/dhkey.der b/vectors/cryptography_vectors/asymmetric/DH/dhkey.der new file mode 100644 index 00000000..07edb8cc Binary files /dev/null and b/vectors/cryptography_vectors/asymmetric/DH/dhkey.der differ diff --git a/vectors/cryptography_vectors/asymmetric/DH/dhkey.pem b/vectors/cryptography_vectors/asymmetric/DH/dhkey.pem new file mode 100644 index 00000000..45ac9e99 --- /dev/null +++ b/vectors/cryptography_vectors/asymmetric/DH/dhkey.pem @@ -0,0 +1,9 @@ +-----BEGIN PRIVATE KEY----- +MIIBIQIBADCBlQYJKoZIhvcNAQMBMIGHAoGBALsrWt44U1ojqTy88o0wfjysBE51 +V6Vtarjm2+5BslQK/RtlndHde3gx+ccNs+InANszcuJFI8AHt4743kGRzy5XSlul +4q4dDJENOHoyqYxueFuFVJELEwLQXrX/McKw+hS6GPVQnw6tZhgGo9apdNdYgeLQ +eQded8Bum8jqzP3rAgECBIGDAoGAcglrcequR+67Nl+FbEjLQb/1toPK5XpMRvsi +V7BCZLqhSUmQBBZGyJFqTm6JXuZSCi/5zVFAfepoe0jmZj7p2I5TlEu+VsKuAK0q +yYhIfOXJouVV21Bv1WVcCfRE8o0w4nsAg3uVt7O7R7c1YqHmfE/pUpP5Na/hdGYi +aWFD94g= +-----END PRIVATE KEY----- diff --git a/vectors/cryptography_vectors/asymmetric/DH/dhkey.txt b/vectors/cryptography_vectors/asymmetric/DH/dhkey.txt new file mode 100644 index 00000000..adfcec73 --- /dev/null +++ b/vectors/cryptography_vectors/asymmetric/DH/dhkey.txt @@ -0,0 +1,6 @@ + +COUNT = 0 +P = 00bb2b5ade38535a23a93cbcf28d307e3cac044e7557a56d6ab8e6dbee41b2540afd1b659dd1dd7b7831f9c70db3e22700db3372e24523c007b78ef8de4191cf2e574a5ba5e2ae1d0c910d387a32a98c6e785b8554910b1302d05eb5ff31c2b0fa14ba18f5509f0ead661806a3d6a974d75881e2d079075e77c06e9bc8eaccfdeb +G = 2 +Y = 00983d5e292c5457c78e3af022a1a9d6808be7a52f4c1e76b20eb235796ba5b8553a1aaffe6cb9b2d0de41db41f2a72f3a3a6284057b4acac31cfbb19bd1ed963facf24187622b33cb0be70829db67150daa8c7b1803cb8347eba451fb26777d6a1dcc53e2271ef4c1349e2f3e5e97a12c138e486bf14d315fdd86ad8b14e3fd3c +X = 72096b71eaae47eebb365f856c48cb41bff5b683cae57a4c46fb2257b04264baa1494990041646c8916a4e6e895ee6520a2ff9cd51407dea687b48e6663ee9d88e53944bbe56c2ae00ad2ac988487ce5c9a2e555db506fd5655c09f444f28d30e27b00837b95b7b3bb47b73562a1e67c4fe95293f935afe1746622696143f788 diff --git a/vectors/cryptography_vectors/asymmetric/DH/dhp.der b/vectors/cryptography_vectors/asymmetric/DH/dhp.der new file mode 100644 index 00000000..8c5edae8 Binary files /dev/null and b/vectors/cryptography_vectors/asymmetric/DH/dhp.der differ diff --git a/vectors/cryptography_vectors/asymmetric/DH/dhp.pem b/vectors/cryptography_vectors/asymmetric/DH/dhp.pem new file mode 100644 index 00000000..1b3f3998 --- /dev/null +++ b/vectors/cryptography_vectors/asymmetric/DH/dhp.pem @@ -0,0 +1,5 @@ +-----BEGIN DH PARAMETERS----- +MIGHAoGBALsrWt44U1ojqTy88o0wfjysBE51V6Vtarjm2+5BslQK/RtlndHde3gx ++ccNs+InANszcuJFI8AHt4743kGRzy5XSlul4q4dDJENOHoyqYxueFuFVJELEwLQ +XrX/McKw+hS6GPVQnw6tZhgGo9apdNdYgeLQeQded8Bum8jqzP3rAgEC +-----END DH PARAMETERS----- diff --git a/vectors/cryptography_vectors/asymmetric/DH/dhpub.der b/vectors/cryptography_vectors/asymmetric/DH/dhpub.der new file mode 100644 index 00000000..4560294f Binary files /dev/null and b/vectors/cryptography_vectors/asymmetric/DH/dhpub.der differ diff --git a/vectors/cryptography_vectors/asymmetric/DH/dhpub.pem b/vectors/cryptography_vectors/asymmetric/DH/dhpub.pem new file mode 100644 index 00000000..945180db --- /dev/null +++ b/vectors/cryptography_vectors/asymmetric/DH/dhpub.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIDCBlQYJKoZIhvcNAQMBMIGHAoGBALsrWt44U1ojqTy88o0wfjysBE51V6Vt +arjm2+5BslQK/RtlndHde3gx+ccNs+InANszcuJFI8AHt4743kGRzy5XSlul4q4d +DJENOHoyqYxueFuFVJELEwLQXrX/McKw+hS6GPVQnw6tZhgGo9apdNdYgeLQeQde +d8Bum8jqzP3rAgECA4GFAAKBgQCYPV4pLFRXx4468CKhqdaAi+elL0wedrIOsjV5 +a6W4VToar/5subLQ3kHbQfKnLzo6YoQFe0rKwxz7sZvR7ZY/rPJBh2IrM8sL5wgp +22cVDaqMexgDy4NH66RR+yZ3fWodzFPiJx70wTSeLz5el6EsE45Ia/FNMV/dhq2L +FOP9PA== +-----END PUBLIC KEY----- -- cgit v1.2.3