feat: update spec url
This commit is contained in:
Generated
+1
-1
@@ -551,7 +551,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "card-cli"
|
||||
version = "1.13.21"
|
||||
version = "1.13.22"
|
||||
dependencies = [
|
||||
"aes-gcm-stream",
|
||||
"authenticator 0.3.1",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "card-cli"
|
||||
version = "1.13.21"
|
||||
version = "1.13.22"
|
||||
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ ssh -i id_user root@example.com
|
||||
<br>
|
||||
|
||||
> `external_*` subcommands follow <<Cryptography external command specification>><br>
|
||||
> Specification: https://openwebstandard.org/rfc1
|
||||
> Specification: https://ows.hatter.in/rfc1
|
||||
|
||||
<br><br>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ use std::collections::BTreeMap;
|
||||
|
||||
pub struct CommandImpl;
|
||||
|
||||
// https://openwebstandard.org/rfc1
|
||||
// https://ows.hatter.in/rfc1
|
||||
impl Command for CommandImpl {
|
||||
fn name(&self) -> &str {
|
||||
"external_spec"
|
||||
|
||||
@@ -19,7 +19,7 @@ pub struct CommandImpl;
|
||||
|
||||
// Format:
|
||||
// {
|
||||
// "schema": "https://openwebstandard.org/simple-sign-file/v1",
|
||||
// "schema": "https://ows.hatter.in/simple-sign-file/v1",
|
||||
// "version": "v1",
|
||||
// "filename": "example.zip",
|
||||
// "digest": "sha256-HEX(SHA256(filename-content))",
|
||||
|
||||
@@ -12,7 +12,7 @@ use x509_parser::time::ASN1Time;
|
||||
|
||||
use crate::argsutil;
|
||||
use crate::digestutil::sha256_bytes;
|
||||
use crate::signfile::{SignFileRequest, SIMPLE_SIG_SCHEMA, SimpleSignFile};
|
||||
use crate::signfile::{SignFileRequest, SIMPLE_SIG_SCHEMA, SIMPLE_SIG_SCHEMA_FORMAL, SimpleSignFile};
|
||||
use crate::util::base64_decode;
|
||||
|
||||
pub struct CommandImpl;
|
||||
@@ -33,7 +33,7 @@ impl Command for CommandImpl {
|
||||
let sign_file_content = opt_result!(fs::read_to_string(&sign_file), "Read file: {}, failed: {}", sign_file);
|
||||
let simple_sign_file: SimpleSignFile = opt_result!(serde_json::from_str(&sign_file_content), "Parse file: {}, failed: {}", sign_file);
|
||||
|
||||
if SIMPLE_SIG_SCHEMA != simple_sign_file.schema {
|
||||
if SIMPLE_SIG_SCHEMA != simple_sign_file.schema || SIMPLE_SIG_SCHEMA_FORMAL != simple_sign_file.schema {
|
||||
return simple_error!("File: {} format error: bad schema", sign_file);
|
||||
}
|
||||
information!("File name: {}", simple_sign_file.filename.as_deref().unwrap_or("<none>"));
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub const SIMPLE_SIG_V1: &str = "v1";
|
||||
pub const SIMPLE_SIG_SCHEMA: &str = "https://openwebstandard.org/simple-sign-file/v1";
|
||||
pub const SIMPLE_SIG_SCHEMA: &str = "https://ows.hatter.in/simple-sign-file/v1";
|
||||
pub const SIMPLE_SIG_SCHEMA_FORMAL: &str = "https://openwebstandard.org/simple-sign-file/v1";
|
||||
pub const HASH_ALGORITHM_SHA256: &str = "sha256";
|
||||
pub const SIGNATURE_ALGORITHM_SHA256_WITH_ECDSA: &str = "SHA256withECDSA";
|
||||
pub const CERTIFICATES_SEARCH_URL: &str = "https://hatter.ink/ca/fetch_certificates.json?fingerprint=";
|
||||
|
||||
Reference in New Issue
Block a user