dotenvx 5.1.13-x86_64-linux → 5.1.14-x86_64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f3214e9eedf9f68aaf971eb32790040174739c569a0d297bf9961b3dcd19afa
4
- data.tar.gz: 88dc937751594148595ce683e67204c603c4e535ca3f314634fa279911eeae10
3
+ metadata.gz: db89bb5c2d7c57b59c666182740b331956a4310b8fb19ec2c4afc7a24a0cbdca
4
+ data.tar.gz: 2bbef4e0f457f7e61ca71c8392ae693dc021f648e73d6680f130194b6940579b
5
5
  SHA512:
6
- metadata.gz: 6e0293577e8742d33019eb2697b73071199587bf82332d7379e7579f1680c6f46a3902d113a8a8366118fb91b53f46312d23f76c26c993c56504c826710aeb27
7
- data.tar.gz: bc39f52626b3e271ef8bf8590357e5d21cfccec03130f1fcd1060ebf66be8ef9dea4a8aa21795d27da3aba6ca02e66c4d04ae7b66224f149965378ac393989f1
6
+ metadata.gz: ce8c1092ec23c5f7b90bbf7d0417b3a6a4cbb2a1615d066fa450a5b4c4e43a043e65ce4fe03e5cf38716908635b0686b6bb11dedb72f681c6074252d7a815b95
7
+ data.tar.gz: 42865157ea38c29d6f9acee12140e6c00cf1f8c0c150a8c5cf14d6f0e4f8905ce3de54b3833996b7489cddae119402a5abbc837221a2dc9fc1baee6fc581112d
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. See [standa
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 5.1.14 (2026-12-03)
8
+
9
+ - Expose `Dotenvx::Primitives` for key generation, derivation, encryption, decryption, and algorithm detection using the shared Rust implementation.
10
+
7
11
  ## 5.1.13 (2026-12-03)
8
12
 
9
13
  - Add built-in ML-KEM-768/AES-256-GCM envelope support through the shared primitives and SDK, including Base64 public keys and private seeds.
data/README.md CHANGED
@@ -115,3 +115,20 @@ The result is a system built entirely from primitives, developers already unders
115
115
  [Read the whitepaper →](https://dotenvx.com/dotenvx.pdf?v=README)
116
116
 
117
117
   
118
+
119
+ ## Primitives
120
+
121
+ Use the same key operations as the CLI without loading files or environment variables:
122
+
123
+ ```ruby
124
+ require "dotenvx/primitives"
125
+
126
+ pair = Dotenvx::Primitives.keypair(algorithm: "mlkem768")
127
+ public_key = Dotenvx::Primitives.derive(pair.fetch("private_key"))
128
+ ciphertext = Dotenvx::Primitives.encrypt(public_key, "hello")
129
+ plaintext = Dotenvx::Primitives.decrypt(pair.fetch("private_key"), ciphertext)
130
+ Dotenvx::Primitives.public_key_algorithm(public_key) # => "mlkem768"
131
+ ```
132
+
133
+ `secp256k1` is the default algorithm. Invalid keys, ciphertext, and unsupported
134
+ algorithms raise `ArgumentError`. Algorithm detection returns `nil` for invalid keys.
Binary file
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "dotenvx"
4
+
5
+ module Dotenvx
6
+ # Key operations shared with the CLI. These methods never read files or ENV.
7
+ module Primitives
8
+ def self.keypair(algorithm: "secp256k1")
9
+ JSON.parse(Native::Primitives.keypair(algorithm))
10
+ end
11
+
12
+ def self.derive(private_key)
13
+ Native::Primitives.derive(private_key)
14
+ end
15
+
16
+ def self.encrypt(public_key, plaintext)
17
+ Native::Primitives.encrypt(public_key, plaintext)
18
+ end
19
+
20
+ def self.decrypt(private_key, ciphertext)
21
+ Native::Primitives.decrypt(private_key, ciphertext)
22
+ end
23
+
24
+ def self.public_key_algorithm(public_key)
25
+ Native::Primitives.public_key_algorithm(public_key)
26
+ end
27
+ end
28
+ end
@@ -1,3 +1,3 @@
1
1
  module Dotenvx
2
- VERSION = "5.1.13"
2
+ VERSION = "5.1.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotenvx
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.13
4
+ version: 5.1.14
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - motdotla
@@ -80,6 +80,7 @@ files:
80
80
  - lib/dotenvx/dotenvx_native.so
81
81
  - lib/dotenvx/load.rb
82
82
  - lib/dotenvx/output.rb
83
+ - lib/dotenvx/primitives.rb
83
84
  - lib/dotenvx/rails.rb
84
85
  - lib/dotenvx/version.rb
85
86
  homepage: https://github.com/dotenvx/dotenvx-ruby#readme