@@ -146,3 +146,58 @@ the PEM encoded certificate, and `signature`, which is the previously calculates
146
146
signature for the data, in the ` signature_format ` which can be ` 'binary' ` , ` 'hex' ` or ` 'base64' ` .
147
147
148
148
Returns true or false depending on the validity of the signature for the data and public key.
149
+
150
+ ### crypto.createDiffieHellman(prime_length)
151
+
152
+ Creates a Diffie-Hellman key exchange object and generates a prime of the
153
+ given bit length. The generator used is ` 2 ` .
154
+
155
+ ### crypto.createDiffieHellman(prime, encoding='binary')
156
+
157
+ Creates a Diffie-Hellman key exchange object using the supplied prime. The
158
+ generator used is ` 2 ` . Encoding can be ` 'binary' ` , ` 'hex' ` , or ` 'base64' ` .
159
+
160
+ ### diffieHellman.generateKeys(encoding='binary')
161
+
162
+ Generates private and public Diffie-Hellman key values, and returns the
163
+ public key in the specified encoding. This key should be transferred to the
164
+ other party. Encoding can be ` 'binary' ` , ` 'hex' ` , or ` 'base64' ` .
165
+
166
+ ### diffieHellman.computeSecret(other_public_key, input_encoding='binary', output_encoding=input_encoding)
167
+
168
+ Computes the shared secret using ` other_public_key ` as the other party's
169
+ public key and returns the computed shared secret. Supplied key is
170
+ interpreted using specified ` input_encoding ` , and secret is encoded using
171
+ specified ` output_encoding ` . Encodings can be ` 'binary' ` , ` 'hex' ` , or
172
+ ` 'base64' ` . If no output encoding is given, the input encoding is used as
173
+ output encoding.
174
+
175
+ ### diffieHellman.getPrime(encoding='binary')
176
+
177
+ Returns the Diffie-Hellman prime in the specified encoding, which can be
178
+ ` 'binary' ` , ` 'hex' ` , or ` 'base64' ` .
179
+
180
+ ### diffieHellman.getGenerator(encoding='binary')
181
+
182
+ Returns the Diffie-Hellman prime in the specified encoding, which can be
183
+ ` 'binary' ` , ` 'hex' ` , or ` 'base64' ` .
184
+
185
+ ### diffieHellman.getPublicKey(encoding='binary')
186
+
187
+ Returns the Diffie-Hellman public key in the specified encoding, which can
188
+ be ` 'binary' ` , ` 'hex' ` , or ` 'base64' ` .
189
+
190
+ ### diffieHellman.getPrivateKey(encoding='binary')
191
+
192
+ Returns the Diffie-Hellman private key in the specified encoding, which can
193
+ be ` 'binary' ` , ` 'hex' ` , or ` 'base64' ` .
194
+
195
+ ### diffieHellman.setPublicKey(public_key, encoding='binary')
196
+
197
+ Sets the Diffie-Hellman public key. Key encoding can be ` 'binary' ` , ` 'hex' ` ,
198
+ or ` 'base64' ` .
199
+
200
+ ### diffieHellman.setPrivateKey(public_key, encoding='binary')
201
+
202
+ Sets the Diffie-Hellman private key. Key encoding can be ` 'binary' ` , ` 'hex' ` , or ` 'base64' ` .
203
+
0 commit comments