简体   繁体   English

ECDHE Curve25519 密钥交换签名和 KeyValue 字段

[英]ECDHE Curve25519 Key Exchange Signature and KeyValue Fields

I have an API where I need to pass the "KeyMaterial" which according to API Docs is for:我有一个 API,我需要在其中传递“KeyMaterial”,根据 API Docs 用于:

Contains the cryptographic parameters that are required to perform End-to-End encryption for sharing the information between the producer and the consumer in a secure manner.

Here is the example they have shared这是他们分享的例子

"KeyMaterial": {
  "cryptoAlg": "ECDHE",
  "curve": "Curve25519",
  "params": "string",
  "DHPublicKey": {
    "expiry": "2018-12-23T11:39:57.153Z",
    "Parameters": "string",
    "KeyValue": "683938505ec529a700fcceab66273d1aa78d494208a4769930f0818872159265"
  },
  "Nonce": "R4s6vNI7I/JfdeA3/6dMMQ==",
  "Signature": "jFJcYCOTVV6iiLPlM7qY+Zz+3PF8oUPFg1byb1GNr+k="
}

They also mention that他们还提到

"Signature" field : Refers the signature standard for more information: https://www.w3.org/TR/xmldsig-core1/ “签名”字段:更多信息参考签名标准: https : //www.w3.org/TR/xmldsig-core1/

"KeyValue" : Contains the value of ephemeral public key "KeyValue" : 包含临时公钥的值

However, I confused to how exactly should I be filling in these parameters.但是,我对如何填写这些参数感到困惑。 I could not find any reference implementations for ECDHE + Curve25519.我找不到 ECDHE + Curve25519 的任何参考实现。 Can anyone explain how exactly can I fill in these parameters?谁能解释一下我如何准确填写这些参数? How do I generate the signature field?如何生成签名字段? and the KeyValue field in "DHPublicKey"和“DHPublicKey”中的 KeyValue 字段

Public Key can be generated like this.公钥可以这样生成。

  1. Generate a X25519 private key : 32 byte random生成 X25519 私钥:32 字节随机

  2. private key * Generator point = Public Key私钥 * 生成点 = 公钥

Nonce must be random bytes transformed into base64 encoding. Nonce 必须是转换为 base64 编码的随机字节。

About the signature, I don't know what kind of signature it is.关于签名,不知道是什么签名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM