Class SemanticEncryption
Provides methods that perform key wrapping based on the encryption purpose and use in the Smartcrypt Protocol.
Inherited Members
Namespace: PKWARE.Smartcrypt.Protocol
Assembly: SmartcryptProtocol.dll
Syntax
public static class SemanticEncryption
Methods
DecryptGroupKey(ICryptoProvider, String, Byte[])
Decrypts a GroupKey.
Declaration
[Pure]
[NotNull]
public static byte[] DecryptGroupKey(this ICryptoProvider cryptoProvider, [NotNull] string data, [NotNull] byte[] privateKey)
Parameters
Type | Name | Description |
---|---|---|
ICryptoProvider | cryptoProvider | The ICryptoProvider to use for cryptographic primitives. |
String | data | The data to decrypt. |
Byte[] | privateKey | The RSA private key of the identity for which the original data was encrypted. |
Returns
Type | Description |
---|---|
Byte[] | The decrypted data. |
Exceptions
Type | Condition |
---|---|
MetaClientException | With Category of CategoryUpgrade if the data are newer than understood by this software. With Category of CategoryInternal if the data are in an invalid format. |
See Also
DecryptHybrid(ICryptoProvider, String, Byte[])
Decrypts a HybridEncryption ciphertext.
Declaration
[Pure]
[NotNull]
public static byte[] DecryptHybrid(this ICryptoProvider cryptoProvider, [NotNull] string data, [NotNull] byte[] privateKey)
Parameters
Type | Name | Description |
---|---|---|
ICryptoProvider | cryptoProvider | The ICryptoProvider to use for cryptographic primitives. |
String | data | The data to decrypt. |
Byte[] | privateKey | The RSA private key of the identity for which the original data was encrypted. |
Returns
Type | Description |
---|---|
Byte[] | The decrypted data. |
Exceptions
Type | Condition |
---|---|
MetaClientException | With Category of CategoryUpgrade if the data are newer than understood by this software. With Category of CategoryInternal if the data are in an invalid format. |
DecryptMasterKey(ICryptoProvider, String, Byte[])
Decrypts a MasterKey.
Declaration
[Pure]
[NotNull]
public static byte[] DecryptMasterKey(this ICryptoProvider cryptoProvider, [NotNull] string data, [NotNull] byte[] privateKey)
Parameters
Type | Name | Description |
---|---|---|
ICryptoProvider | cryptoProvider | The ICryptoProvider to use for cryptographic primitives. |
String | data | The data to decrypt. |
Byte[] | privateKey | The RSA private key of the identity for which the original data was encrypted. |
Returns
Type | Description |
---|---|
Byte[] | The decrypted data. |
Exceptions
Type | Condition |
---|---|
MetaClientException | With Category of CategoryUpgrade if the data are newer than understood by this software. With Category of CategoryInternal if the data are in an invalid format. |
See Also
EncryptGroupKey(ICryptoProvider, Byte[], String)
Encrypts a GroupKey.
Declaration
[Pure]
[NotNull]
public static string EncryptGroupKey(this ICryptoProvider cryptoProvider, [NotNull] byte[] data, [NotNull] string recipientPublicKey)
Parameters
Type | Name | Description |
---|---|---|
ICryptoProvider | cryptoProvider | The ICryptoProvider to use for cryptographic primitives. |
Byte[] | data | The data to encrypt. |
String | recipientPublicKey | The RSA public key of the recipient. |
Returns
Type | Description |
---|---|
String | The encrypted data. |
Exceptions
Type | Condition |
---|---|
MetaClientException | With Category of CategoryUpgrade if the data are newer than understood by this software. With Category of CategoryInternal if the data are in an invalid format. |
See Also
EncryptHybrid(ICryptoProvider, Byte[], String)
Encrypts using HybridEncryption.
Declaration
[Pure]
[NotNull]
public static string EncryptHybrid(this ICryptoProvider cryptoProvider, [NotNull] byte[] data, [NotNull] string recipientPublicKey)
Parameters
Type | Name | Description |
---|---|---|
ICryptoProvider | cryptoProvider | The ICryptoProvider to use for cryptographic primitives. |
Byte[] | data | The data to encrypt. |
String | recipientPublicKey | The RSA public key of the recipient. |
Returns
Type | Description |
---|---|
String | The encrypted data. |
Exceptions
Type | Condition |
---|---|
MetaClientException | With Category of CategoryUpgrade if the data are newer than understood by this software. With Category of CategoryInternal if the data are in an invalid format. |
See Also
EncryptMasterKey(ICryptoProvider, Byte[], String)
Encrypts a MasterKey.
Declaration
[Pure]
[NotNull]
public static string EncryptMasterKey(this ICryptoProvider cryptoProvider, [NotNull] byte[] data, [NotNull] string recipientPublicKey)
Parameters
Type | Name | Description |
---|---|---|
ICryptoProvider | cryptoProvider | The ICryptoProvider to use for cryptographic primitives. |
Byte[] | data | The data to encrypt. |
String | recipientPublicKey | The RSA public key of the recipient. |
Returns
Type | Description |
---|---|
String | The encrypted data. |
Exceptions
Type | Condition |
---|---|
MetaClientException | With Category of CategoryUpgrade if the data are newer than understood by this software. With Category of CategoryInternal if the data are in an invalid format. |