Show / Hide Table of Contents

Class EphermalKey

A short term key on a curve.

Inheritance
Object
EphermalKey
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: PeerTalk.Cryptography
Assembly: PeerTalk.dll
Syntax
public class EphermalKey
Remarks

Ephemeral keys are different from other keys in IPFS; they are NOT protobuf encoded and are NOT self describing. The encoding is an uncompressed ECPoint; the first byte s a 4 and followed by X and Y co-ordinates.

It as assummed that the curve name is known a priori.

Methods

| Improve this Doc View Source

CreatePublicKeyFromIpfs(String, Byte[])

Create a public key from the IPFS ephermal encoding.

Declaration
public static EphermalKey CreatePublicKeyFromIpfs(string curveName, byte[] bytes)
Parameters
Type Name Description
String curveName

The name of the curve, for example "P-256".

Byte[] bytes

The IPFS encoded ephermal key.

Returns
Type Description
EphermalKey
| Improve this Doc View Source

Generate(String)

Create a new ephermal key on the curve.

Declaration
public static EphermalKey Generate(string curveName)
Parameters
Type Name Description
String curveName

The name of the curve, for example "P-256".

Returns
Type Description
EphermalKey

The new created emphermal key.

| Improve this Doc View Source

GenerateSharedSecret(EphermalKey)

Create a shared secret between this key and another.

Declaration
public byte[] GenerateSharedSecret(EphermalKey other)
Parameters
Type Name Description
EphermalKey other

Another ephermal key.

Returns
Type Description
Byte[]

The shared secret as a byte array.

Remarks

Uses the ECDH agreement algorithm to generate the shared secet.

| Improve this Doc View Source

PublicKeyBytes()

Gets the IPFS encoding of the public key.

Declaration
public byte[] PublicKeyBytes()
Returns
Type Description
Byte[]

Returns the uncompressed EC point.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX