ruby-c2pa 0.1.0
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +217 -0
- data/Rakefile +18 -0
- data/ext/c2pa_native/Cargo.toml +19 -0
- data/ext/c2pa_native/extconf.rb +4 -0
- data/ext/c2pa_native/src/lib.rs +118 -0
- data/ext/c2pa_native/target/release/build/oid-registry-c350c75504c969dc/out/oid_db.rs +540 -0
- data/ext/c2pa_native/target/release/build/pix-f303ab89d734032b/out/gamma_lut.rs +68 -0
- data/ext/c2pa_native/target/release/build/serde-2e9abb4d9d73cae4/out/private.rs +6 -0
- data/ext/c2pa_native/target/release/build/serde-f471616b462b0caf/out/private.rs +6 -0
- data/ext/c2pa_native/target/release/build/serde_core-2b94e9134dc44065/out/private.rs +5 -0
- data/ext/c2pa_native/target/release/build/serde_core-3dc945fa0ab21dd5/out/private.rs +5 -0
- data/ext/c2pa_native/target/release/build/thiserror-a1f4c63469c326b9/out/private.rs +5 -0
- data/ext/c2pa_native/target/release/build/typenum-4eb7d34b9fb695ef/out/tests.rs +20563 -0
- data/ext/c2pa_native/target/release/build/typenum-b8de96984639a942/out/tests.rs +20563 -0
- data/lib/c2pa/error.rb +6 -0
- data/lib/c2pa/version.rb +3 -0
- data/lib/c2pa.rb +59 -0
- data/ruby-c2pa.gemspec +25 -0
- metadata +118 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 2614c646f329045c531fa61cd95903caccd0ca0d074b347c4f0363ed802954ce
|
|
4
|
+
data.tar.gz: f458055549d05b45c4c1e5b6f1a9ba63e0c011bcb57103613021503a275c93e4
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 1cac6a50c7d09591daac9c152349b921be8b3fd22844824bff9005fb287524d490f0924387ace3b0e2c845504b1c0c9ff5f21a50d16e9d4a57f84540e668f540
|
|
7
|
+
data.tar.gz: 84945029e6511a1a802bf7d483f9353e6d407af7e5373e3b9ea6490052b55570faa2fea515cc281e26a7ff602951d3c552e44c7743d165868ed02a956004afcf
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Carlos Rodriguez
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# ruby-c2pa
|
|
2
|
+
|
|
3
|
+
A Ruby gem for signing and reading [C2PA](https://c2pa.org) content credentials in media files. Built on top of the official [c2pa-rs](https://github.com/contentauth/c2pa-rs) Rust library via FFI.
|
|
4
|
+
|
|
5
|
+
## What is C2PA?
|
|
6
|
+
|
|
7
|
+
C2PA (Coalition for Content Provenance and Authenticity) is an open technical standard for attaching cryptographically signed provenance metadata to media files. It lets you prove:
|
|
8
|
+
|
|
9
|
+
- Who created or edited a file
|
|
10
|
+
- What tools were used
|
|
11
|
+
- When and where it was created
|
|
12
|
+
- Whether the content has been tampered with since signing
|
|
13
|
+
|
|
14
|
+
It is backed by Adobe, Microsoft, Google, the BBC, and others, and is increasingly required by platforms and publishers to establish trust in digital media — particularly in an era of AI-generated content.
|
|
15
|
+
|
|
16
|
+
## Why Rust bindings?
|
|
17
|
+
|
|
18
|
+
The C2PA specification is complex and security-sensitive. The reference implementation is [c2pa-rs](https://github.com/contentauth/c2pa-rs), an official Rust library maintained by the Content Authenticity Initiative. Rather than re-implementing the specification in Ruby (which would risk diverging from the spec or introducing security bugs), this gem wraps c2pa-rs directly.
|
|
19
|
+
|
|
20
|
+
The binding layer is a thin Rust library that exposes a C-compatible API (`extern "C"` functions), which Ruby loads at runtime using the [ffi](https://github.com/ffi/ffi) gem. This means:
|
|
21
|
+
|
|
22
|
+
- **Correctness** — you get the reference implementation, not a reimplementation
|
|
23
|
+
- **Security** — cryptographic signing and manifest validation are handled by audited Rust code
|
|
24
|
+
- **Performance** — signing large video files happens in native code with no Ruby overhead
|
|
25
|
+
- **Spec compliance** — as c2pa-rs is updated to track the spec, you get those updates by bumping the Rust dependency
|
|
26
|
+
|
|
27
|
+
## Requirements
|
|
28
|
+
|
|
29
|
+
- Ruby >= 3.0
|
|
30
|
+
- Rust and Cargo (to compile the native library)
|
|
31
|
+
- OpenSSL (usually already present on macOS and Linux)
|
|
32
|
+
|
|
33
|
+
### Installing Rust
|
|
34
|
+
|
|
35
|
+
The compilation happens automatically during `gem install`, but Rust must be present on your system first.
|
|
36
|
+
|
|
37
|
+
The recommended way is via [mise](https://mise.jdx.dev), which can manage both Ruby and Rust in one place:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
mise use --global rust@latest
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or via the official [rustup](https://rustup.rs) installer:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
Add to your Gemfile:
|
|
52
|
+
|
|
53
|
+
```ruby
|
|
54
|
+
gem "ruby-c2pa"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Then run:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
bundle install
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The native Rust library is compiled automatically during installation. This takes a few minutes the first time as it downloads and compiles the c2pa-rs dependency tree.
|
|
64
|
+
|
|
65
|
+
## Preparing your certificate and key
|
|
66
|
+
|
|
67
|
+
C2PA signing requires an X.509 certificate and private key in PEM format. For testing you can generate a self-signed pair:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Generate a private key (ES256 = ECDSA with P-256)
|
|
71
|
+
openssl ecparam -name prime256v1 -genkey -noout -out creator.key
|
|
72
|
+
|
|
73
|
+
# Generate a self-signed certificate
|
|
74
|
+
openssl req -new -x509 -key creator.key -out creator.pem -days 365 \
|
|
75
|
+
-subj "/CN=My Name/O=My Organization"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
For production use, obtain a certificate from a CA that is trusted by the C2PA ecosystem. The certificate file should contain the full chain (end-entity certificate first, then any intermediates), but should **not** include the root CA.
|
|
79
|
+
|
|
80
|
+
The supported signing algorithms are: `es256`, `es384`, `es512`, `ps256`, `ps384`, `ps512`, `ed25519`.
|
|
81
|
+
|
|
82
|
+
## Usage
|
|
83
|
+
|
|
84
|
+
### Signing a file
|
|
85
|
+
|
|
86
|
+
```ruby
|
|
87
|
+
require "c2pa"
|
|
88
|
+
|
|
89
|
+
# Sign in place (overwrites the original file)
|
|
90
|
+
C2PA.sign(
|
|
91
|
+
file: "video.mp4",
|
|
92
|
+
certificate: "creator.pem",
|
|
93
|
+
key: "creator.key"
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
# Sign to a new file
|
|
97
|
+
C2PA.sign(
|
|
98
|
+
file: "video.mp4",
|
|
99
|
+
output: "video_signed.mp4",
|
|
100
|
+
certificate: "creator.pem",
|
|
101
|
+
key: "creator.key"
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# Specify a signing algorithm (default is "es256")
|
|
105
|
+
C2PA.sign(
|
|
106
|
+
file: "photo.jpg",
|
|
107
|
+
certificate: "creator.pem",
|
|
108
|
+
key: "creator.key",
|
|
109
|
+
algorithm: "ps256"
|
|
110
|
+
)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Providing a manifest
|
|
114
|
+
|
|
115
|
+
If you omit `manifest:`, a minimal one is generated using the filename as the title. You can provide your own:
|
|
116
|
+
|
|
117
|
+
```ruby
|
|
118
|
+
C2PA.sign(
|
|
119
|
+
file: "photo.jpg",
|
|
120
|
+
certificate: "creator.pem",
|
|
121
|
+
key: "creator.key",
|
|
122
|
+
manifest: {
|
|
123
|
+
title: "Sunset over the bay",
|
|
124
|
+
assertions: [
|
|
125
|
+
{
|
|
126
|
+
label: "stds.schema-org.CreativeWork",
|
|
127
|
+
data: {
|
|
128
|
+
"@context": "https://schema.org",
|
|
129
|
+
"@type": "CreativeWork",
|
|
130
|
+
"author": [{ "@type": "Person", "name": "Jane Smith" }]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
The manifest hash is serialized to JSON and passed directly to c2pa-rs. See the [C2PA specification](https://c2pa.org/specifications/specifications/2.1/specs/C2PA_Specification.html) and [c2pa-rs manifest documentation](https://opensource.contentauthenticity.org/docs/rust-sdk/) for the full list of supported fields and assertion types.
|
|
139
|
+
|
|
140
|
+
### Reading a manifest
|
|
141
|
+
|
|
142
|
+
```ruby
|
|
143
|
+
manifest = C2PA.read(file: "photo_signed.jpg")
|
|
144
|
+
|
|
145
|
+
puts manifest["title"]
|
|
146
|
+
puts manifest["claim_generator"]
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Checking the SDK version
|
|
150
|
+
|
|
151
|
+
```ruby
|
|
152
|
+
puts C2PA.sdk_version # => "0.78.2"
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Error handling
|
|
156
|
+
|
|
157
|
+
All errors inherit from `C2PA::Error`, so you can rescue broadly or narrowly:
|
|
158
|
+
|
|
159
|
+
```ruby
|
|
160
|
+
begin
|
|
161
|
+
C2PA.sign(file: "photo.jpg", certificate: "cert.pem", key: "key.pem")
|
|
162
|
+
rescue C2PA::SigningError => e
|
|
163
|
+
puts "Signing failed: #{e.message}"
|
|
164
|
+
rescue C2PA::ReadError => e
|
|
165
|
+
puts "Could not read manifest: #{e.message}"
|
|
166
|
+
rescue C2PA::Error => e
|
|
167
|
+
puts "C2PA error: #{e.message}"
|
|
168
|
+
end
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Supported file formats
|
|
172
|
+
|
|
173
|
+
Signing and reading are supported for any format supported by c2pa-rs, including:
|
|
174
|
+
|
|
175
|
+
| Format | MIME type |
|
|
176
|
+
|--------|-----------|
|
|
177
|
+
| JPEG | `image/jpeg` |
|
|
178
|
+
| PNG | `image/png` |
|
|
179
|
+
| WebP | `image/webp` |
|
|
180
|
+
| TIFF | `image/tiff` |
|
|
181
|
+
| AVIF | `image/avif` |
|
|
182
|
+
| MP4 / M4V | `video/mp4` |
|
|
183
|
+
| MOV | `video/quicktime` |
|
|
184
|
+
| MP3 | `audio/mpeg` |
|
|
185
|
+
| WAV | `audio/wav` |
|
|
186
|
+
| PDF | `application/pdf` |
|
|
187
|
+
|
|
188
|
+
The format is detected automatically from the file extension.
|
|
189
|
+
|
|
190
|
+
## How it works
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
Ruby (C2PA.sign)
|
|
194
|
+
│
|
|
195
|
+
│ ffi gem — passes strings as C pointers
|
|
196
|
+
▼
|
|
197
|
+
Rust (c2pa_sign_file)
|
|
198
|
+
│
|
|
199
|
+
│ calls c2pa-rs Builder API
|
|
200
|
+
▼
|
|
201
|
+
c2pa-rs — embeds signed manifest into the file
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
The Rust layer (`ext/c2pa_native/src/lib.rs`) exposes four functions with a C-compatible ABI:
|
|
205
|
+
|
|
206
|
+
| Function | Description |
|
|
207
|
+
|----------|-------------|
|
|
208
|
+
| `c2pa_sign_file` | Sign a file and write the result |
|
|
209
|
+
| `c2pa_read_file` | Read and return the manifest JSON |
|
|
210
|
+
| `c2pa_last_error` | Return the last error message |
|
|
211
|
+
| `c2pa_free_string` | Free a string allocated by Rust |
|
|
212
|
+
|
|
213
|
+
Errors are stored in Rust thread-local storage and surfaced to Ruby as typed exceptions.
|
|
214
|
+
|
|
215
|
+
## License
|
|
216
|
+
|
|
217
|
+
MIT
|
data/Rakefile
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require "rake/extensiontask"
|
|
2
|
+
require "rake/testtask"
|
|
3
|
+
|
|
4
|
+
GEMSPEC = Gem::Specification.load("ruby-c2pa.gemspec")
|
|
5
|
+
|
|
6
|
+
Rake::ExtensionTask.new("c2pa_native", GEMSPEC) do |ext|
|
|
7
|
+
ext.lib_dir = "lib/c2pa"
|
|
8
|
+
ext.source_pattern = "**/*.{rs,toml,rb}"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
Rake::TestTask.new(:test) do |t|
|
|
12
|
+
t.libs << "lib" << "test"
|
|
13
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
|
14
|
+
t.verbose = true
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
task test: :compile
|
|
18
|
+
task default: :test
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "c2pa_native"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
[lib]
|
|
7
|
+
name = "c2pa_native"
|
|
8
|
+
crate-type = ["cdylib"]
|
|
9
|
+
|
|
10
|
+
[dependencies]
|
|
11
|
+
magnus = { version = "0.8", features = [] }
|
|
12
|
+
c2pa = { version = "0.78", features = ["file_io"] }
|
|
13
|
+
serde_json = "1"
|
|
14
|
+
|
|
15
|
+
[profile.release]
|
|
16
|
+
opt-level = 3
|
|
17
|
+
lto = true
|
|
18
|
+
codegen-units = 1
|
|
19
|
+
strip = true
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
use std::path::Path;
|
|
2
|
+
|
|
3
|
+
use c2pa::{create_signer, Builder, Reader, SigningAlg};
|
|
4
|
+
use magnus::{function, prelude::*, Error, Ruby};
|
|
5
|
+
|
|
6
|
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
7
|
+
|
|
8
|
+
fn alg_from_str(alg: &str) -> Result<SigningAlg, String> {
|
|
9
|
+
match alg.to_lowercase().as_str() {
|
|
10
|
+
"ps256" => Ok(SigningAlg::Ps256),
|
|
11
|
+
"ps384" => Ok(SigningAlg::Ps384),
|
|
12
|
+
"ps512" => Ok(SigningAlg::Ps512),
|
|
13
|
+
"es256" => Ok(SigningAlg::Es256),
|
|
14
|
+
"es384" => Ok(SigningAlg::Es384),
|
|
15
|
+
"es512" => Ok(SigningAlg::Es512),
|
|
16
|
+
"ed25519" => Ok(SigningAlg::Ed25519),
|
|
17
|
+
_ => Err(format!(
|
|
18
|
+
"Unknown signing algorithm: '{}'. Valid options: ps256, ps384, ps512, es256, es384, es512, ed25519",
|
|
19
|
+
alg
|
|
20
|
+
)),
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// ─── Core logic ──────────────────────────────────────────────────────────────
|
|
25
|
+
|
|
26
|
+
fn do_sign_file(
|
|
27
|
+
source_path: &str,
|
|
28
|
+
dest_path: &str,
|
|
29
|
+
cert_path: &str,
|
|
30
|
+
key_path: &str,
|
|
31
|
+
alg_str: &str,
|
|
32
|
+
manifest_json: Option<&str>,
|
|
33
|
+
) -> Result<(), Box<dyn std::error::Error>> {
|
|
34
|
+
let cert = std::fs::read(cert_path)
|
|
35
|
+
.map_err(|e| format!("Cannot read certificate '{}': {}", cert_path, e))?;
|
|
36
|
+
let key = std::fs::read(key_path)
|
|
37
|
+
.map_err(|e| format!("Cannot read key '{}': {}", key_path, e))?;
|
|
38
|
+
|
|
39
|
+
let alg = alg_from_str(alg_str)?;
|
|
40
|
+
let signer = create_signer::from_keys(&cert, &key, alg, None)
|
|
41
|
+
.map_err(|e| format!("Failed to create signer: {}", e))?;
|
|
42
|
+
|
|
43
|
+
let title = Path::new(source_path)
|
|
44
|
+
.file_name()
|
|
45
|
+
.and_then(|n| n.to_str())
|
|
46
|
+
.unwrap_or("unknown")
|
|
47
|
+
.replace('"', "\\\"");
|
|
48
|
+
let default_json = format!(r#"{{"title": "{}"}}"#, title);
|
|
49
|
+
let json = manifest_json.unwrap_or(&default_json);
|
|
50
|
+
|
|
51
|
+
let mut builder = Builder::from_json(json)
|
|
52
|
+
.map_err(|e| format!("Invalid manifest JSON: {}", e))?;
|
|
53
|
+
|
|
54
|
+
// Always write to a temp file then rename so that source == dest is safe
|
|
55
|
+
let tmp_path = format!("{}.c2pa_tmp_{}", dest_path, std::process::id());
|
|
56
|
+
|
|
57
|
+
match builder.sign_file(&*signer, source_path, &tmp_path) {
|
|
58
|
+
Ok(_) => {}
|
|
59
|
+
Err(e) => {
|
|
60
|
+
let _ = std::fs::remove_file(&tmp_path);
|
|
61
|
+
return Err(format!("Signing failed: {}", e).into());
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
std::fs::rename(&tmp_path, dest_path).map_err(|e| {
|
|
66
|
+
let _ = std::fs::remove_file(&tmp_path);
|
|
67
|
+
format!("Failed to move signed file to '{}': {}", dest_path, e)
|
|
68
|
+
})?;
|
|
69
|
+
|
|
70
|
+
Ok(())
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
fn do_read_file(path: &str) -> Result<String, Box<dyn std::error::Error>> {
|
|
74
|
+
let reader = Reader::from_file(path)
|
|
75
|
+
.map_err(|e| format!("Failed to read manifest from '{}': {}", path, e))?;
|
|
76
|
+
Ok(reader.json())
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// ─── Ruby-facing functions ────────────────────────────────────────────────────
|
|
80
|
+
|
|
81
|
+
fn sign_file(
|
|
82
|
+
source: String,
|
|
83
|
+
dest: String,
|
|
84
|
+
cert: String,
|
|
85
|
+
key: String,
|
|
86
|
+
alg: Option<String>,
|
|
87
|
+
manifest_json: Option<String>,
|
|
88
|
+
) -> Result<String, Error> {
|
|
89
|
+
let alg_str = alg.as_deref().unwrap_or("es256");
|
|
90
|
+
|
|
91
|
+
do_sign_file(&source, &dest, &cert, &key, alg_str, manifest_json.as_deref())
|
|
92
|
+
.map_err(|e| Error::new(Ruby::get().expect("called from Ruby thread").exception_runtime_error(), e.to_string()))?;
|
|
93
|
+
|
|
94
|
+
Ok(dest)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
fn read_file(path: String) -> Result<String, Error> {
|
|
98
|
+
do_read_file(&path)
|
|
99
|
+
.map_err(|e| Error::new(Ruby::get().expect("called from Ruby thread").exception_runtime_error(), e.to_string()))
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
fn sdk_version() -> String {
|
|
103
|
+
c2pa::VERSION.to_string()
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ─── Extension entry point ────────────────────────────────────────────────────
|
|
107
|
+
|
|
108
|
+
#[magnus::init]
|
|
109
|
+
fn init(ruby: &Ruby) -> Result<(), Error> {
|
|
110
|
+
let c2pa = ruby.define_module("C2PA")?;
|
|
111
|
+
let native = c2pa.define_module("Native")?;
|
|
112
|
+
|
|
113
|
+
native.define_singleton_method("sign_file", function!(sign_file, 6))?;
|
|
114
|
+
native.define_singleton_method("read_file", function!(read_file, 1))?;
|
|
115
|
+
native.define_singleton_method("sdk_version", function!(sdk_version, 0))?;
|
|
116
|
+
|
|
117
|
+
Ok(())
|
|
118
|
+
}
|