Class Key
An asymmetric key.
Inherited Members
Namespace: PeerTalk.Cryptography
Assembly: PeerTalk.dll
Syntax
public class Key
Methods
| Improve this Doc View SourceCreatePrivateKey(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 |
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. |
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. |
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 |
Exceptions
| Type | Condition |
|---|---|
| InvalidDataException | The |