C# Class Goedel.Cryptography.Jose.JoseWebEncryption

Represents a JWE data structure.
ファイルを表示 Open project: hallambaker/Mathematical-Mesh Class Usage Examples

Public Methods

Method Description
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.

Private Methods

Method Description
Find ( string KeyID ) : Recipient

Method Details

Add() public method

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.
return void

Add() public method

Add a recipient entry to the recipient list.
public Add ( Recipient Recipient ) : void
Recipient Recipient
return void

Decrypt() public method

Decrypt the content using the corresponding private key in the local key store (if found). Throws exception otherwise.
public Decrypt ( ) : byte[]
return byte[]

Decrypt() public method

Decrypt the content using the specified private key.
public Decrypt ( KeyPair DecryptionKey ) : byte[]
DecryptionKey Goedel.Cryptography.KeyPair
return byte[]

DeserializeToken() public method

Having read a tag, process the corresponding value data.
public DeserializeToken ( JSONReader JSONReader, string Tag ) : void
JSONReader JSONReader
Tag string
return void

Encrypt() public method

Create a new encryption context and encrypt the data under the generated content key and IV.
public Encrypt ( byte Data ) : void
Data byte
return void

Encrypt() public method

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.
return void

EncryptKey() public method

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.
return byte[]

From() public static method

Create a new instance from untagged byte input. i.e. {... data ... }
public static From ( byte _Data ) : JoseWebEncryption
_Data byte The input data.
return JoseWebEncryption

From() public static method

Create a new instance from untagged string input. i.e. {... data ... }
public static From ( string _Input ) : JoseWebEncryption
_Input string The input data.
return JoseWebEncryption

FromTagged() public static method

Deserialize a tagged stream
public static FromTagged ( JSONReader JSONReader ) : JoseWebEncryption
JSONReader JSONReader
return JoseWebEncryption

FromTagged() public static method

Create a new instance from tagged byte input. i.e. { "JoseWebEncryption" : {... data ... } }
public static FromTagged ( byte _Data ) : JoseWebEncryption
_Data byte The input data.
return JoseWebEncryption

FromTagged() public static method

Create a new instance from tagged string input. i.e. { "JoseWebEncryption" : {... data ... } }
public static FromTagged ( string _Input ) : JoseWebEncryption
_Input string The input data.
return JoseWebEncryption

JoseWebEncryption() public method

Default Constructor
public JoseWebEncryption ( ) : System
return System

JoseWebEncryption() public method

Initialize class from JSONReader stream.
public JoseWebEncryption ( JSONReader JSONReader ) : System
JSONReader JSONReader
return System

JoseWebEncryption() public method

Initialize class from a JSON encoded class.
public JoseWebEncryption ( string _String ) : System
_String string
return System

JoseWebEncryption() public method

Construct a JWE encryption object and encrypt the specified data.
public JoseWebEncryption ( byte Data ) : System.Collections.Generic
Data byte The data to be encrypted.
return System.Collections.Generic

JoseWebEncryption() public method

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.
return System.Collections.Generic

JoseWebEncryption() public method

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.
return System.Collections.Generic

Serialize() public method

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.
return void

SerializeX() public method

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.
return void

Tag() public method

Tag identifying this class.
public Tag ( ) : string
return string