Show / Hide Table of Contents

Class Key

An asymmetric key.

Inheritance
Object
Key
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 Key

Methods

| Improve this Doc View Source

CreatePrivateKey(AsymmetricKeyParameter)

Create the key from the Bouncy Castle private key.

Declaration
public static Key CreatePrivateKey(AsymmetricKeyParameter privateKey)
Parameters
Type Name Description
Org.BouncyCastle.Crypto.AsymmetricKeyParameter privateKey

The Bouncy Castle private key.

Returns
Type Description
Key
| Improve this Doc View Source

CreatePublicKeyFromIpfs(Byte[])

Create a public key from the IPFS message.

Declaration
public static Key CreatePublicKeyFromIpfs(byte[] bytes)
Parameters
Type Name Description
Byte[] bytes

The IPFS encoded protobuf PublicKey message.

Returns
Type Description
Key

The public key.

| Improve this Doc View Source

Sign(Byte[])

Create a signature for the data.

Declaration
public byte[] Sign(byte[] data)
Parameters
Type Name Description
Byte[] data

The data to sign.

Returns
Type Description
Byte[]

The signature.

| Improve this Doc View Source

Verify(Byte[], Byte[])

Verify that signature matches the data.

Declaration
public void Verify(byte[] data, byte[] signature)
Parameters
Type Name Description
Byte[] data

The data to check.

Byte[] signature

The supplied signature of the data.

Exceptions
Type Condition
InvalidDataException

The data does match the signature.

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