Skip to content

Commit e4a7a3a

Browse files
authored
Merge pull request #83 from rodrigofranzoi/v-0-3-3
v0.3.3 version
2 parents ee2f602 + fa428a3 commit e4a7a3a

File tree

30 files changed

+1020
-48
lines changed

30 files changed

+1020
-48
lines changed

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,15 @@ Cargo.lock
2626
# vim
2727
*.swp
2828

29-
.idea
29+
.idea
30+
31+
# Mac OS X Finder
32+
.DS_Store
33+
34+
# Xcode
35+
xcuserdata/
36+
project.xcworkspace/
37+
DerivedData/
38+
39+
# Cocoapods
40+
Pods/

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ name = 'routing'
2323

2424
[package]
2525
name = 'didcomm'
26-
version = '0.3.2'
26+
version = '0.3.3'
2727
authors = ['Vyacheslav Gudkov <vyacheslav.gudkov@dsr-corporation.com>']
2828
edition = '2018'
2929
description = 'DIDComm for Rust'
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Pod::Spec.new do |spec|
2+
3+
spec.name = "DidcommSDK"
4+
spec.version = "0.3.1"
5+
spec.summary = "Didcomm v2 created from rust."
6+
7+
spec.description = "Didcomm v2 created from rust. UNIFFI was used to convert from rust to Swift."
8+
spec.homepage = "https://github.com/sicpa-dlab/didcomm-rust"
9+
10+
spec.license = { :type => 'Apache License 2.0', :file => 'LICENSE.txt' }
11+
12+
spec.authors = { "Sicpa-Dlab" => "dlab@sicpa.com" }
13+
spec.platforms = { :ios => "10.0" }
14+
spec.source = { :http => 'https://github.com/sicpa-dlab/didcomm-rust/releases/download/v0.3.1/didcomm-swift-0.3.1.tar.gz'}
15+
spec.swift_version = '4.0'
16+
17+
spec.ios.vendored_library = '*.a'
18+
spec.source_files = ['didcomm.swift', 'didcommFFI.h']
19+
20+
spec.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64 i386' }
21+
spec.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64 i386' }
22+
23+
end
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Pod::Spec.new do |spec|
2+
3+
spec.name = "DidcommSDK"
4+
spec.version = "0.3.2"
5+
spec.summary = "Didcomm v2 created from rust."
6+
7+
spec.description = "Didcomm v2 created from rust. UNIFFI was used to convert from rust to Swift."
8+
spec.homepage = "https://github.com/sicpa-dlab/didcomm-rust"
9+
10+
spec.license = { :type => 'Apache License 2.0', :file => 'LICENSE.txt' }
11+
12+
spec.authors = { "Sicpa-Dlab" => "dlab@sicpa.com" }
13+
spec.platforms = { :ios => "10.0" }
14+
spec.source = { :http => 'https://github.com/sicpa-dlab/didcomm-rust/releases/download/v0.3.2/didcomm-swift-0.3.2.tar.gz'}
15+
spec.swift_version = '4.0'
16+
17+
spec.ios.vendored_library = '*.a'
18+
spec.source_files = ['didcomm.swift', 'didcommFFI.h']
19+
20+
spec.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64 i386' }
21+
spec.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64 i386' }
22+
23+
end
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Pod::Spec.new do |spec|
2+
3+
spec.name = "DidcommSDK"
4+
spec.version = "0.3.3"
5+
spec.summary = "Didcomm v2 created from rust."
6+
7+
spec.description = "Didcomm v2 created from rust. UNIFFI was used to convert from rust to Swift."
8+
spec.homepage = "https://github.com/sicpa-dlab/didcomm-rust"
9+
10+
spec.license = { :type => 'Apache License 2.0', :file => 'LICENSE.txt' }
11+
12+
spec.authors = { "Sicpa-Dlab" => "dlab@sicpa.com" }
13+
spec.platforms = { :ios => "10.0" }
14+
spec.source = { :http => 'https://github.com/sicpa-dlab/didcomm-rust/releases/download/v0.3.3/didcomm-swift-0.3.3.tar.gz'}
15+
spec.swift_version = '4.0'
16+
17+
spec.ios.vendored_library = '*.a'
18+
spec.source_files = ['didcomm.swift', 'didcommFFI.h']
19+
20+
spec.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64 i386' }
21+
spec.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64 i386' }
22+
23+
end

Specs/didcomm-swift/0.3.1/didcomm-swift.podspec

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/jwe/encrypt.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use askar_crypto::{
55
random,
66
repr::{KeyGen, ToSecretBytes},
77
};
8+
use std::borrow::Cow;
89

910
use sha2::{Digest, Sha256};
1011

@@ -50,7 +51,7 @@ where
5051
let apv = base64::encode_config(apv, base64::URL_SAFE_NO_PAD);
5152

5253
let p = ProtectedHeader {
53-
typ: Some("application/didcomm-encrypted+json"),
54+
typ: Some(Cow::Borrowed("application/didcomm-encrypted+json")),
5455
alg: alg.clone(),
5556
enc,
5657
skid,

src/jwe/envelope.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use serde::{Deserialize, Serialize};
22
use serde_enum_str::{Deserialize_enum_str, Serialize_enum_str};
33
use serde_json::Value;
4+
use std::borrow::Cow;
45

56
/// Subset of JWE in generic json serialization form used for authcrypt
67
/// and anoncrypt message types.
@@ -29,7 +30,7 @@ pub(crate) struct ProtectedHeader<'a> {
2930
/// Must be `application/didcomm-encrypted+json` or `didcomm-encrypted+json` for now.
3031
/// Something like `application/didcomm-encrypted+cbor` can be introduced in the
3132
/// future.
32-
pub typ: Option<&'a str>,
33+
pub typ: Option<Cow<'a, str>>,
3334

3435
/// Cryptographic algorithm used to encrypt or determine the value of the CEK.
3536
pub alg: Algorithm,

src/jwe/parse.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ impl<'a, 'b> ParsedJWE<'a, 'b> {
9191
#[cfg(test)]
9292
mod tests {
9393
use serde_json::json;
94+
use std::borrow::Cow;
9495

9596
use crate::{
9697
error::ErrorKind,
@@ -158,7 +159,7 @@ mod tests {
158159
tag: "6ylC_iAs4JvDQzXeY6MuYQ",
159160
},
160161
protected: ProtectedHeader {
161-
typ: Some("application/didcomm-encrypted+json"),
162+
typ: Some(Cow::Borrowed("application/didcomm-encrypted+json")),
162163
alg: jwe::envelope::Algorithm::EcdhEsA256kw,
163164
enc: EncAlgorithm::Xc20P,
164165
skid: None,
@@ -235,7 +236,7 @@ mod tests {
235236
tag: "6ylC_iAs4JvDQzXeY6MuYQ",
236237
},
237238
protected: ProtectedHeader {
238-
typ: Some("application/didcomm-encrypted+json"),
239+
typ: Some(Cow::Borrowed("application/didcomm-encrypted+json")),
239240
alg: jwe::envelope::Algorithm::EcdhEsA256kw,
240241
enc: EncAlgorithm::Xc20P,
241242
skid: None,
@@ -311,7 +312,7 @@ mod tests {
311312
tag: "6ylC_iAs4JvDQzXeY6MuYQ",
312313
},
313314
protected: ProtectedHeader {
314-
typ: Some("application/didcomm-encrypted+json"),
315+
typ: Some(Cow::Borrowed("application/didcomm-encrypted+json")),
315316
alg: jwe::envelope::Algorithm::EcdhEsA256kw,
316317
enc: EncAlgorithm::Xc20P,
317318
skid: None,
@@ -387,7 +388,7 @@ mod tests {
387388
tag: "uYeo7IsZjN7AnvBjUZE5lNryNENbf6_zew_VC-d4b3U",
388389
},
389390
protected: ProtectedHeader {
390-
typ: Some("application/didcomm-encrypted+json"),
391+
typ: Some(Cow::Borrowed("application/didcomm-encrypted+json")),
391392
alg: jwe::envelope::Algorithm::Ecdh1puA256kw,
392393
enc: EncAlgorithm::A256cbcHs512,
393394
skid: Some("did:example:alice#key-x25519-1"),
@@ -464,7 +465,7 @@ mod tests {
464465
tag: "uYeo7IsZjN7AnvBjUZE5lNryNENbf6_zew_VC-d4b3U",
465466
},
466467
protected: ProtectedHeader {
467-
typ: Some("application/didcomm-encrypted+json"),
468+
typ: Some(Cow::Borrowed("application/didcomm-encrypted+json")),
468469
alg: jwe::envelope::Algorithm::Ecdh1puA256kw,
469470
enc: EncAlgorithm::A256cbcHs512,
470471
skid: Some("did:example:alice#key-x25519-1"),
@@ -540,7 +541,7 @@ mod tests {
540541
tag: "uYeo7IsZjN7AnvBjUZE5lNryNENbf6_zew_VC-d4b3U",
541542
},
542543
protected: ProtectedHeader {
543-
typ: Some("application/didcomm-encrypted+json"),
544+
typ: Some(Cow::Borrowed("application/didcomm-encrypted+json")),
544545
alg: jwe::envelope::Algorithm::Ecdh1puA256kw,
545546
enc: EncAlgorithm::A256cbcHs512,
546547
skid: Some("did:example:alice#key-x25519-1"),
@@ -965,7 +966,7 @@ mod tests {
965966
tag: "6ylC_iAs4JvDQzXeY6MuYQ",
966967
},
967968
protected: ProtectedHeader {
968-
typ: Some("application/didcomm-encrypted+json"),
969+
typ: Some(Cow::Borrowed("application/didcomm-encrypted+json")),
969970
alg: jwe::envelope::Algorithm::EcdhEsA256kw,
970971
enc: EncAlgorithm::Xc20P,
971972
skid: None,
@@ -1044,7 +1045,7 @@ mod tests {
10441045
tag: "uYeo7IsZjN7AnvBjUZE5lNryNENbf6_zew_VC-d4b3U",
10451046
},
10461047
protected: ProtectedHeader {
1047-
typ: Some("application/didcomm-encrypted+json"),
1048+
typ: Some(Cow::Borrowed("application/didcomm-encrypted+json")),
10481049
alg: jwe::envelope::Algorithm::Ecdh1puA256kw,
10491050
enc: EncAlgorithm::A256cbcHs512,
10501051
skid: Some("did:example:alice#key-x25519-1"),

src/jws/envelope.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use askar_crypto::sign::SignatureType;
22
use serde::{Deserialize, Serialize};
33
use serde_enum_str::{Deserialize_enum_str, Serialize_enum_str};
4+
use std::borrow::Cow;
45

56
use crate::error::{err_msg, ErrorKind, Result};
67

@@ -37,7 +38,7 @@ pub(crate) struct ProtectedHeader<'a> {
3738
/// Must be `application/didcomm-signed+json` or `didcomm-signed+json` for now.
3839
/// Something like `application/didcomm-signed+cbor` can be introduced in the
3940
/// future.
40-
pub typ: &'a str,
41+
pub typ: Cow<'a, str>,
4142

4243
/// Cryptographic algorithm used to produce signature.
4344
pub alg: Algorithm,

0 commit comments

Comments
 (0)