Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement parsing GPG keys #373

Merged
merged 11 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
with:
submodules: true

- name: Install additional build dependencies
run: |
sudo apt-get update
sudo apt-get install nettle-dev capnproto

- name: Cache Cargo registry and build artifacts
uses: actions/cache@v2
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/target
Cargo.lock

.vscode
17 changes: 10 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ license = "Apache-2.0"
description = "Core library for Verifiable Credentials and Decentralized Identifiers."
repository = "https://github.com/spruceid/ssi/"
documentation = "https://docs.rs/ssi/"
resolver = "2"

exclude = [
"json-ld-api/*",
"json-ld-normalization/*",
]
exclude = ["json-ld-api/*", "json-ld-normalization/*"]

[features]
default = ["ring"]
http-did = ["hyper", "hyper-tls", "http", "percent-encoding", "tokio"]
libsecp256k1 = ["secp256k1"] # backward compatibility
libsecp256k1 = ["secp256k1"] # backward compatibility
secp256k1 = ["k256", "rand", "k256/keccak256"]
secp256r1 = ["p256", "rand"]
ripemd-160 = ["ripemd160", "secp256k1"]
Expand Down Expand Up @@ -58,7 +56,12 @@ lazy_static = "1.4"
combination = "0.1"
sha2 = { version = "0.9", optional = true }
sha2_old = { package = "sha2", version = "0.8" }
hyper = { version = "0.14", optional = true, features = ["server", "client", "http1", "stream"] }
hyper = { version = "0.14", optional = true, features = [
"server",
"client",
"http1",
"stream",
] }
hyper-tls = { version = "0.5", optional = true }
http = { version = "0.2", optional = true }
hex = "0.4"
Expand Down Expand Up @@ -106,7 +109,7 @@ members = [
]

[dev-dependencies]
blake2 = "0.8" # for bbs doctest
blake2 = "0.8" # for bbs doctest
uuid = { version = "0.8", features = ["v4", "serde"] }
difference = "2.0"
did-method-key = { path = "./did-key" }
Expand Down
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[![](https://img.shields.io/github/workflow/status/spruceid/ssi/ci)](https://github.com/spruceid/ssi/actions?query=workflow%3Aci+branch%3Amain) [![](https://img.shields.io/badge/Rust-v1.51.0-orange)](https://www.rust-lang.org/) [![](https://img.shields.io/badge/License-Apache--2.0-green)](https://github.com/spruceid/didkit/blob/main/LICENSE) [![](https://img.shields.io/twitter/follow/sprucesystems?label=Follow&style=social)](https://twitter.com/sprucesystems)
[![](https://img.shields.io/github/workflow/status/spruceid/ssi/ci)](https://github.com/spruceid/ssi/actions?query=workflow%3Aci+branch%3Amain)
[![](https://img.shields.io/badge/Rust-v1.51.0-orange)](https://www.rust-lang.org/)
[![](https://img.shields.io/badge/License-Apache--2.0-green)](https://github.com/spruceid/didkit/blob/main/LICENSE)
[![](https://img.shields.io/twitter/follow/sprucesystems?label=Follow&style=social)](https://twitter.com/sprucesystems)

SSI's documentation is currently packaged with the DIDKit documentation
[here](https://spruceid.dev/docs/didkit/).
Expand All @@ -14,8 +17,9 @@ including embedded systems. This library is embedded in the the cross-platform
![DIDKit core components](https://user-images.githubusercontent.com/37127325/132885372-9cdf586e-ba6f-44c8-8b83-f72f16d86107.png)

## Maturity Disclaimer
In the v0.1 release on January 27th, 2021, SSI has not yet undergone a
formal security audit and to desired levels of confidence for suitable use in

In the v0.1 release on January 27th, 2021, SSI has not yet undergone a formal
security audit and to desired levels of confidence for suitable use in
production systems. This implementation is currently suitable for exploratory
work and experimentation only. We welcome feedback on the usability,
architecture, and security of this implementation and are committed to a
Expand All @@ -36,6 +40,18 @@ clang
openssl-devel
```

If using feature `did-webkey/sequoia-openpgp` for PGP support, the following
dependencies are also needed:

```
nettle-dev
capnproto
```

If using feature
[`did-webkey/crypto-cng`](https://gitlab.com/sequoia-pgp/sequoia#cryptography),
only `capnproto` is needed.

## Install

### Crates.io
Expand Down
49 changes: 37 additions & 12 deletions did-webkey/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,48 @@ homepage = "https://github.com/spruceid/ssi/tree/main/did-webkey/"
documentation = "https://docs.rs/did-webkey/"

[features]
default = ["ssi/ring", "crypto-nettle"]
crypto-cng = ["sequoia-openpgp/crypto-cng"]
crypto-nettle = ["sequoia-openpgp/crypto-nettle"]
p256 = ["ssi/p256"]

[dependencies]
ssi = { version = "0.3", path = "../", default-features = false }
async-trait = "0.1"
reqwest = { version = "0.11", features = ["json"] }
http = "0.2"
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
sshkeys = "0.3"
ssi = { version = "0.3", path = "../", default-features = false, features = [
"secp256r1",
] }
anyhow = "1.0.52"
async-trait = "0.1.52"
reqwest = { version = "0.11.9", features = ["json"] }
hex = "0.4.3"
http = "0.2.6"
serde_json = "1.0.75"
serde = { version = "1.0.134", features = ["derive"] }
sshkeys = "0.3.1"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
sequoia-openpgp = { version = "1.7.0", features = [
"compression-deflate",
], default-features = false, optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
sequoia-openpgp = { version = "1.7.0", default-features = false, features = [
"crypto-rust",
"allow-experimental-crypto",
"allow-variable-time-crypto",
] }


[target.'cfg(target_os = "android")'.dependencies.reqwest]
version = "0.11"
version = "0.11.9"
features = ["json", "native-tls-vendored"]

[dev-dependencies]
tokio = { version = "1.0", features = ["macros"] }
async-std = { version = "1.9", features = ["attributes"] }
futures = "0.3"
hyper = { version = "0.14", features = ["server", "client", "http1", "stream"] }
tokio = { version = "1.15.0", features = ["macros"] }
async-std = { version = "1.10.0", features = ["attributes"] }
futures = "0.3.19"
hyper = { version = "0.14.16", features = [
"server",
"client",
"http1",
"stream",
] }
Loading