Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
RSAOAEPKeyExchangeFormatter.cs
Go to the documentation of this file.
1
using
System.Runtime.Versioning
;
2
3
namespace
System.Security.Cryptography
;
4
5
[UnsupportedOSPlatform(
"browser"
)]
6
public
class
RSAOAEPKeyExchangeFormatter
:
AsymmetricKeyExchangeFormatter
7
{
8
private
byte
[]
ParameterValue
;
9
10
private
RSA
_rsaKey
;
11
12
private
RandomNumberGenerator
RngValue
;
13
14
public
byte
[]?
Parameter
15
{
16
get
17
{
18
if
(
ParameterValue
!=
null
)
19
{
20
return
(
byte
[])
ParameterValue
.Clone();
21
}
22
return
null
;
23
}
24
set
25
{
26
if
(
value
!=
null
)
27
{
28
ParameterValue
= (
byte
[])
value
.Clone();
29
}
30
else
31
{
32
ParameterValue
=
null
;
33
}
34
}
35
}
36
37
public
override
string
?
Parameters
=>
null
;
38
39
public
RandomNumberGenerator
?
Rng
40
{
41
get
42
{
43
return
RngValue
;
44
}
45
set
46
{
47
RngValue
=
value
;
48
}
49
}
50
51
public
RSAOAEPKeyExchangeFormatter
()
52
{
53
}
54
55
public
RSAOAEPKeyExchangeFormatter
(
AsymmetricAlgorithm
key
)
56
{
57
if
(
key
==
null
)
58
{
59
throw
new
ArgumentNullException
(
"key"
);
60
}
61
_rsaKey
= (
RSA
)
key
;
62
}
63
64
public
override
void
SetKey
(
AsymmetricAlgorithm
key
)
65
{
66
if
(
key
==
null
)
67
{
68
throw
new
ArgumentNullException
(
"key"
);
69
}
70
_rsaKey
= (
RSA
)
key
;
71
}
72
73
public
override
byte
[]
CreateKeyExchange
(
byte
[] rgbData,
Type
? symAlgType)
74
{
75
return
CreateKeyExchange
(rgbData);
76
}
77
78
public
override
byte
[]
CreateKeyExchange
(
byte
[] rgbData)
79
{
80
if
(
_rsaKey
==
null
)
81
{
82
throw
new
CryptographicUnexpectedOperationException
(
System
.
SR
.
Cryptography_MissingKey
);
83
}
84
return
_rsaKey
.
Encrypt
(rgbData,
RSAEncryptionPadding
.
OaepSHA1
);
85
}
86
}
System.ArgumentNullException
Definition
ArgumentNullException.cs:10
System.SR.Cryptography_MissingKey
static string Cryptography_MissingKey
Definition
SR.cs:114
System.SR
Definition
SR.cs:7
System.Security.Cryptography.AsymmetricAlgorithm
Definition
AsymmetricAlgorithm.cs:6
System.Security.Cryptography.AsymmetricKeyExchangeFormatter
Definition
AsymmetricKeyExchangeFormatter.cs:7
System.Security.Cryptography.CryptographicUnexpectedOperationException
Definition
CryptographicUnexpectedOperationException.cs:10
System.Security.Cryptography.RSAEncryptionPadding.OaepSHA1
static RSAEncryptionPadding OaepSHA1
Definition
RSAEncryptionPadding.cs:25
System.Security.Cryptography.RSAEncryptionPadding
Definition
RSAEncryptionPadding.cs:8
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter.RSAOAEPKeyExchangeFormatter
RSAOAEPKeyExchangeFormatter(AsymmetricAlgorithm key)
Definition
RSAOAEPKeyExchangeFormatter.cs:55
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter.SetKey
override void SetKey(AsymmetricAlgorithm key)
Definition
RSAOAEPKeyExchangeFormatter.cs:64
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter.RngValue
RandomNumberGenerator RngValue
Definition
RSAOAEPKeyExchangeFormatter.cs:12
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter.Parameters
override? string Parameters
Definition
RSAOAEPKeyExchangeFormatter.cs:37
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter.RSAOAEPKeyExchangeFormatter
RSAOAEPKeyExchangeFormatter()
Definition
RSAOAEPKeyExchangeFormatter.cs:51
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter._rsaKey
RSA _rsaKey
Definition
RSAOAEPKeyExchangeFormatter.cs:10
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter.ParameterValue
byte[] ParameterValue
Definition
RSAOAEPKeyExchangeFormatter.cs:8
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter.Rng
RandomNumberGenerator? Rng
Definition
RSAOAEPKeyExchangeFormatter.cs:40
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter.CreateKeyExchange
override byte[] CreateKeyExchange(byte[] rgbData, Type? symAlgType)
Definition
RSAOAEPKeyExchangeFormatter.cs:73
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter.CreateKeyExchange
override byte[] CreateKeyExchange(byte[] rgbData)
Definition
RSAOAEPKeyExchangeFormatter.cs:78
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter.Parameter
byte?[] Parameter
Definition
RSAOAEPKeyExchangeFormatter.cs:15
System.Security.Cryptography.RSAOAEPKeyExchangeFormatter
Definition
RSAOAEPKeyExchangeFormatter.cs:7
System.Security.Cryptography.RSA.Encrypt
virtual byte[] Encrypt(byte[] data, RSAEncryptionPadding padding)
Definition
RSA.cs:60
System.Security.Cryptography.RSA
Definition
RSA.cs:15
System.Security.Cryptography.RandomNumberGenerator
Definition
RandomNumberGenerator.cs:9
System.Type
Definition
Type.cs:14
System.Runtime.Versioning
Definition
NonVersionableAttribute.cs:1
System.Security.Cryptography
Definition
CryptoPool.cs:3
System.ExceptionArgument.value
@ value
System.ExceptionArgument.key
@ key
System
Definition
BlockingCollection.cs:8
source
System.Security.Cryptography.Algorithms
System.Security.Cryptography
RSAOAEPKeyExchangeFormatter.cs
Generated by
1.10.0