diff options
author | Luca Casonato <hello@lcas.dev> | 2024-08-08 11:35:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-08 15:05:29 +0530 |
commit | 93d479252b5a18e6e782c74b808240bd3ef036bd (patch) | |
tree | 4c8b83797fb0e30d1ce3fcebad3fbde6cf33ef1d /ext/node/ops/crypto/pkcs3.rs | |
parent | 507e5b74ff21161ba8bd947d7d9cee317c0af379 (diff) |
fix(ext/node): add crypto.diffieHellman (#24938)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Closes #21806
Diffstat (limited to 'ext/node/ops/crypto/pkcs3.rs')
-rw-r--r-- | ext/node/ops/crypto/pkcs3.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/node/ops/crypto/pkcs3.rs b/ext/node/ops/crypto/pkcs3.rs new file mode 100644 index 000000000..577251460 --- /dev/null +++ b/ext/node/ops/crypto/pkcs3.rs @@ -0,0 +1,20 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +// +// PKCS #3: Diffie-Hellman Key Agreement Standard + +use der::Sequence; +use spki::der; +use spki::der::asn1; + +// The parameters fields associated with OID dhKeyAgreement +// +// DHParameter ::= SEQUENCE { +// prime INTEGER, -- p +// base INTEGER, -- g +// privateValueLength INTEGER OPTIONAL } +#[derive(Clone, Sequence)] +pub struct DhParameter { + pub prime: asn1::Int, + pub base: asn1::Int, + pub private_value_length: Option<asn1::Int>, +} |