C# Класс Goedel.Cryptography.Jose.JoseWebEncryption

Represents a JWE data structure.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Add ( KeyPair EncryptionKey ) : void

Add an entry for the specified key to the recipient list.

Add ( Recipient Recipient ) : void

Add a recipient entry to the recipient list.

Decrypt ( ) : byte[]

Decrypt the content using the corresponding private key in the local key store (if found). Throws exception otherwise.

Decrypt ( KeyPair DecryptionKey ) : byte[]

Decrypt the content using the specified private key.

DeserializeToken ( JSONReader JSONReader, string Tag ) : void

Having read a tag, process the corresponding value data.

Encrypt ( byte Data ) : void

Create a new encryption context and encrypt the data under the generated content key and IV.

Encrypt ( byte Data, CryptoProviderEncryption Encryptor ) : void

Create a new encryption context and encrypt the data under the generated content key and IV.

EncryptKey ( KeyPair EncryptionKey ) : byte[]

Return an encrypted key data entry for the specified encryption key.

From ( byte _Data ) : JoseWebEncryption

Create a new instance from untagged byte input. i.e. {... data ... }

From ( string _Input ) : JoseWebEncryption

Create a new instance from untagged string input. i.e. {... data ... }

FromTagged ( JSONReader JSONReader ) : JoseWebEncryption

Deserialize a tagged stream

FromTagged ( byte _Data ) : JoseWebEncryption

Create a new instance from tagged byte input. i.e. { "JoseWebEncryption" : {... data ... } }

FromTagged ( string _Input ) : JoseWebEncryption

Create a new instance from tagged string input. i.e. { "JoseWebEncryption" : {... data ... } }

JoseWebEncryption ( ) : System

Default Constructor

JoseWebEncryption ( JSONReader JSONReader ) : System

Initialize class from JSONReader stream.

JoseWebEncryption ( string _String ) : System

Initialize class from a JSON encoded class.

JoseWebEncryption ( byte Data ) : System.Collections.Generic

Construct a JWE encryption object and encrypt the specified data.

JoseWebEncryption ( byte Data, CryptoProviderEncryption Encryptor ) : System.Collections.Generic

Construct a JWE encryption object and encrypt the specified data using the specified encryption provider.

JoseWebEncryption ( byte Data, List Recipients ) : System.Collections.Generic

Construct a JWE encryption object and encrypt the specified data and create decryption entries for the specified recipients.

Serialize ( Writer Writer, bool wrap, bool &first ) : void

Serialize this object to the specified output stream.

SerializeX ( Writer _Writer, bool _wrap, bool &_first ) : void

Serialize this object to the specified output stream. Unlike the Serlialize() method, this method is not inherited from the parent class allowing a specific version of the method to be called.

Tag ( ) : string

Tag identifying this class.

Приватные методы

Метод Описание
Find ( string KeyID ) : Recipient

Описание методов

Add() публичный Метод

Add an entry for the specified key to the recipient list.
public Add ( KeyPair EncryptionKey ) : void
EncryptionKey Goedel.Cryptography.KeyPair The encryption key to create the /// entry for.
Результат void

Add() публичный Метод

Add a recipient entry to the recipient list.
public Add ( Recipient Recipient ) : void
Recipient Recipient
Результат void

Decrypt() публичный Метод

Decrypt the content using the corresponding private key in the local key store (if found). Throws exception otherwise.
public Decrypt ( ) : byte[]
Результат byte[]

Decrypt() публичный Метод

Decrypt the content using the specified private key.
public Decrypt ( KeyPair DecryptionKey ) : byte[]
DecryptionKey Goedel.Cryptography.KeyPair
Результат byte[]

DeserializeToken() публичный Метод

Having read a tag, process the corresponding value data.
public DeserializeToken ( JSONReader JSONReader, string Tag ) : void
JSONReader JSONReader
Tag string
Результат void

Encrypt() публичный Метод

Create a new encryption context and encrypt the data under the generated content key and IV.
public Encrypt ( byte Data ) : void
Data byte
Результат void

Encrypt() публичный Метод

Create a new encryption context and encrypt the data under the generated content key and IV.
public Encrypt ( byte Data, CryptoProviderEncryption Encryptor ) : void
Data byte The data to encrypt
Encryptor Goedel.Cryptography.CryptoProviderEncryption The encryption provider to use.
Результат void

EncryptKey() публичный Метод

Return an encrypted key data entry for the specified encryption key.
public EncryptKey ( KeyPair EncryptionKey ) : byte[]
EncryptionKey Goedel.Cryptography.KeyPair The key to use for encryption.
Результат byte[]

From() публичный статический Метод

Create a new instance from untagged byte input. i.e. {... data ... }
public static From ( byte _Data ) : JoseWebEncryption
_Data byte The input data.
Результат JoseWebEncryption

From() публичный статический Метод

Create a new instance from untagged string input. i.e. {... data ... }
public static From ( string _Input ) : JoseWebEncryption
_Input string The input data.
Результат JoseWebEncryption

FromTagged() публичный статический Метод

Deserialize a tagged stream
public static FromTagged ( JSONReader JSONReader ) : JoseWebEncryption
JSONReader JSONReader
Результат JoseWebEncryption

FromTagged() публичный статический Метод

Create a new instance from tagged byte input. i.e. { "JoseWebEncryption" : {... data ... } }
public static FromTagged ( byte _Data ) : JoseWebEncryption
_Data byte The input data.
Результат JoseWebEncryption

FromTagged() публичный статический Метод

Create a new instance from tagged string input. i.e. { "JoseWebEncryption" : {... data ... } }
public static FromTagged ( string _Input ) : JoseWebEncryption
_Input string The input data.
Результат JoseWebEncryption

JoseWebEncryption() публичный Метод

Default Constructor
public JoseWebEncryption ( ) : System
Результат System

JoseWebEncryption() публичный Метод

Initialize class from JSONReader stream.
public JoseWebEncryption ( JSONReader JSONReader ) : System
JSONReader JSONReader
Результат System

JoseWebEncryption() публичный Метод

Initialize class from a JSON encoded class.
public JoseWebEncryption ( string _String ) : System
_String string
Результат System

JoseWebEncryption() публичный Метод

Construct a JWE encryption object and encrypt the specified data.
public JoseWebEncryption ( byte Data ) : System.Collections.Generic
Data byte The data to be encrypted.
Результат System.Collections.Generic

JoseWebEncryption() публичный Метод

Construct a JWE encryption object and encrypt the specified data using the specified encryption provider.
public JoseWebEncryption ( byte Data, CryptoProviderEncryption Encryptor ) : System.Collections.Generic
Data byte The data to be encrypted.
Encryptor Goedel.Cryptography.CryptoProviderEncryption Encryption provider to use.
Результат System.Collections.Generic

JoseWebEncryption() публичный Метод

Construct a JWE encryption object and encrypt the specified data and create decryption entries for the specified recipients.
public JoseWebEncryption ( byte Data, List Recipients ) : System.Collections.Generic
Data byte The data to be encrypted.
Recipients List The recipients to create the /// decryption blobs for.
Результат System.Collections.Generic

Serialize() публичный Метод

Serialize this object to the specified output stream.
public Serialize ( Writer Writer, bool wrap, bool &first ) : void
Writer Writer Output stream
wrap bool If true, output is wrapped with object /// start and end sequences '{ ... }'.
first bool If true, item is the first entry in a list.
Результат void

SerializeX() публичный Метод

Serialize this object to the specified output stream. Unlike the Serlialize() method, this method is not inherited from the parent class allowing a specific version of the method to be called.
public SerializeX ( Writer _Writer, bool _wrap, bool &_first ) : void
_Writer Writer Output stream
_wrap bool If true, output is wrapped with object /// start and end sequences '{ ... }'.
_first bool If true, item is the first entry in a list.
Результат void

Tag() публичный Метод

Tag identifying this class.
public Tag ( ) : string
Результат string