Package system.security.cryptography
Class RSA
- java.lang.Object
-
- org.mases.jcobridge.netreflection.NetObject
-
- system.security.cryptography.AsymmetricAlgorithm
-
- system.security.cryptography.RSA
-
- All Implemented Interfaces:
AutoCloseable
,IJCOBridgeReflected
- Direct Known Subclasses:
RSACng
,RSACryptoServiceProvider
public class RSA extends AsymmetricAlgorithm
The base .NET class managing System.Security.Cryptography.RSA, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.See: https://docs.microsoft.com/en-us/dotnet/api/System.Security.Cryptography.RSA
-
-
Field Summary
Fields Modifier and Type Field Description static String
assemblyFullName
Fully assembly qualified name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089static String
assemblyShortName
Assembly name: mscorlibstatic String
className
Qualified class name: System.Security.Cryptography.RSAstatic JCType
classType
The type managed from JCOBridge.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RSA
cast(IJCOBridgeReflected from)
Try to cast theIJCOBridgeReflected
instance intoRSA
, a cast assert is made to check if types are compatible.static RSA
Create(int keySizeInBits)
static RSA
Create(RSAParameters parameters)
static RSA
CreateNewRSA()
static RSA
CreateNewRSA(String algName)
byte[]
Decrypt(byte[] data, RSAEncryptionPadding padding)
byte[]
Decrypt(JCORefOut dupParam0, RSAEncryptionPadding dupParam1)
byte[]
DecryptValue(byte[] rgb)
byte[]
DecryptValue(JCORefOut dupParam0)
byte[]
Encrypt(byte[] data, RSAEncryptionPadding padding)
byte[]
Encrypt(JCORefOut dupParam0, RSAEncryptionPadding dupParam1)
byte[]
EncryptValue(byte[] rgb)
byte[]
EncryptValue(JCORefOut dupParam0)
RSAParameters
ExportParameters(boolean includePrivateParameters)
void
FromXmlString(String xmlString)
String
getJCOAssemblyName()
Returns the reflected Assembly nameString
getJCOClassName()
Returns the reflected Class nameObject
getJCOInstance()
Returns the instantiated classString
getJCOObjectName()
Returns the reflected Class name used to build the objectJCType
getJCOType()
Returns the instantiated class Typevoid
ImportParameters(RSAParameters parameters)
void
setJCOInstance(JCObject instance)
byte[]
SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
byte[]
SignData(byte[] data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
byte[]
SignData(JCORefOut dupParam0, int dupParam1, int dupParam2, HashAlgorithmName dupParam3, RSASignaturePadding dupParam4)
byte[]
SignData(JCORefOut dupParam0, HashAlgorithmName dupParam1, RSASignaturePadding dupParam2)
byte[]
SignData(Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
byte[]
SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
byte[]
SignHash(JCORefOut dupParam0, HashAlgorithmName dupParam1, RSASignaturePadding dupParam2)
String
ToXmlString(boolean includePrivateParameters)
boolean
VerifyData(byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
boolean
VerifyData(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
boolean
VerifyData(JCORefOut dupParam0, int dupParam1, int dupParam2, JCORefOut dupParam3, HashAlgorithmName dupParam4, RSASignaturePadding dupParam5)
boolean
VerifyData(JCORefOut dupParam0, JCORefOut dupParam1, HashAlgorithmName dupParam2, RSASignaturePadding dupParam3)
boolean
VerifyData(Stream data, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
boolean
VerifyData(Stream dupParam0, JCORefOut dupParam1, HashAlgorithmName dupParam2, RSASignaturePadding dupParam3)
boolean
VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding)
boolean
VerifyHash(JCORefOut dupParam0, JCORefOut dupParam1, HashAlgorithmName dupParam2, RSASignaturePadding dupParam3)
-
Methods inherited from class system.security.cryptography.AsymmetricAlgorithm
Clear, close, Create, Create, Dispose, getKeyExchangeAlgorithm, getKeySize, getLegalKeySizes, getSignatureAlgorithm, setKeySize
-
Methods inherited from class org.mases.jcobridge.netreflection.NetObject
Equals, Equals, GetHashCode, GetType, hashCode, toObjectFromArray, toObjectFromArray, toString, ToString, translateException
-
-
-
-
Field Detail
-
assemblyFullName
public static final String assemblyFullName
Fully assembly qualified name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089- See Also:
- Constant Field Values
-
assemblyShortName
public static final String assemblyShortName
Assembly name: mscorlib- See Also:
- Constant Field Values
-
className
public static final String className
Qualified class name: System.Security.Cryptography.RSA- See Also:
- Constant Field Values
-
-
Method Detail
-
getJCOAssemblyName
public String getJCOAssemblyName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Assembly name- Specified by:
getJCOAssemblyName
in interfaceIJCOBridgeReflected
- Overrides:
getJCOAssemblyName
in classAsymmetricAlgorithm
- Returns:
- A
String
representing the Fullname of reflected Assembly
-
getJCOClassName
public String getJCOClassName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Class name- Specified by:
getJCOClassName
in interfaceIJCOBridgeReflected
- Overrides:
getJCOClassName
in classAsymmetricAlgorithm
- Returns:
- A
String
representing the Fullname of reflected Class
-
getJCOObjectName
public String getJCOObjectName()
Description copied from interface:IJCOBridgeReflected
Returns the reflected Class name used to build the object- Specified by:
getJCOObjectName
in interfaceIJCOBridgeReflected
- Overrides:
getJCOObjectName
in classAsymmetricAlgorithm
- Returns:
- A
String
representing the name used to allocated the object in CLR context
-
getJCOInstance
public Object getJCOInstance()
Description copied from interface:IJCOBridgeReflected
Returns the instantiated class- Specified by:
getJCOInstance
in interfaceIJCOBridgeReflected
- Overrides:
getJCOInstance
in classAsymmetricAlgorithm
- Returns:
- An
Object
representing the CLR instance of the instantiated Class
-
setJCOInstance
public void setJCOInstance(JCObject instance)
- Overrides:
setJCOInstance
in classAsymmetricAlgorithm
-
getJCOType
public JCType getJCOType()
Description copied from interface:IJCOBridgeReflected
Returns the instantiated class Type- Specified by:
getJCOType
in interfaceIJCOBridgeReflected
- Overrides:
getJCOType
in classAsymmetricAlgorithm
- Returns:
- A
JCType
representing the CLR Type of the instantiated Class
-
cast
public static RSA cast(IJCOBridgeReflected from) throws Throwable
Try to cast theIJCOBridgeReflected
instance intoRSA
, a cast assert is made to check if types are compatible.- Parameters:
from
-IJCOBridgeReflected
instance to be casted- Returns:
RSA
instance- Throws:
Throwable
- in case of error during cast operation
-
VerifyData
public boolean VerifyData(byte[] data, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) throws Throwable, ArgumentNullException, ArgumentOutOfRangeException
-
VerifyData
public boolean VerifyData(JCORefOut dupParam0, JCORefOut dupParam1, HashAlgorithmName dupParam2, RSASignaturePadding dupParam3) throws Throwable, ArgumentNullException, ArgumentOutOfRangeException
-
VerifyData
public boolean VerifyData(byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) throws Throwable, ArgumentNullException, ArgumentOutOfRangeException
-
VerifyData
public boolean VerifyData(JCORefOut dupParam0, int dupParam1, int dupParam2, JCORefOut dupParam3, HashAlgorithmName dupParam4, RSASignaturePadding dupParam5) throws Throwable, ArgumentNullException, ArgumentOutOfRangeException
-
VerifyData
public boolean VerifyData(Stream data, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) throws Throwable, ArgumentNullException
- Throws:
Throwable
ArgumentNullException
-
VerifyData
public boolean VerifyData(Stream dupParam0, JCORefOut dupParam1, HashAlgorithmName dupParam2, RSASignaturePadding dupParam3) throws Throwable, ArgumentNullException
- Throws:
Throwable
ArgumentNullException
-
VerifyHash
public boolean VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) throws Throwable
- Throws:
Throwable
-
VerifyHash
public boolean VerifyHash(JCORefOut dupParam0, JCORefOut dupParam1, HashAlgorithmName dupParam2, RSASignaturePadding dupParam3) throws Throwable
- Throws:
Throwable
-
Decrypt
public byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) throws Throwable
- Throws:
Throwable
-
Decrypt
public byte[] Decrypt(JCORefOut dupParam0, RSAEncryptionPadding dupParam1) throws Throwable
- Throws:
Throwable
-
DecryptValue
public byte[] DecryptValue(byte[] rgb) throws Throwable, NotSupportedException
- Throws:
Throwable
NotSupportedException
-
DecryptValue
public byte[] DecryptValue(JCORefOut dupParam0) throws Throwable, NotSupportedException
- Throws:
Throwable
NotSupportedException
-
Encrypt
public byte[] Encrypt(byte[] data, RSAEncryptionPadding padding) throws Throwable
- Throws:
Throwable
-
Encrypt
public byte[] Encrypt(JCORefOut dupParam0, RSAEncryptionPadding dupParam1) throws Throwable
- Throws:
Throwable
-
EncryptValue
public byte[] EncryptValue(byte[] rgb) throws Throwable, NotSupportedException
- Throws:
Throwable
NotSupportedException
-
EncryptValue
public byte[] EncryptValue(JCORefOut dupParam0) throws Throwable, NotSupportedException
- Throws:
Throwable
NotSupportedException
-
SignData
public byte[] SignData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) throws Throwable, ArgumentNullException, ArgumentOutOfRangeException
-
SignData
public byte[] SignData(JCORefOut dupParam0, int dupParam1, int dupParam2, HashAlgorithmName dupParam3, RSASignaturePadding dupParam4) throws Throwable, ArgumentNullException, ArgumentOutOfRangeException
-
SignData
public byte[] SignData(byte[] data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) throws Throwable, ArgumentNullException, ArgumentOutOfRangeException
-
SignData
public byte[] SignData(JCORefOut dupParam0, HashAlgorithmName dupParam1, RSASignaturePadding dupParam2) throws Throwable, ArgumentNullException, ArgumentOutOfRangeException
-
SignData
public byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) throws Throwable, ArgumentNullException
- Throws:
Throwable
ArgumentNullException
-
SignHash
public byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) throws Throwable
- Throws:
Throwable
-
SignHash
public byte[] SignHash(JCORefOut dupParam0, HashAlgorithmName dupParam1, RSASignaturePadding dupParam2) throws Throwable
- Throws:
Throwable
-
CreateNewRSA
public static RSA CreateNewRSA() throws Throwable, ArgumentNullException, ArgumentException, InvalidOperationException, IndexOutOfRangeException, SecurityException, NotSupportedException, ArgumentOutOfRangeException, ApplicationException, CultureNotFoundException, TypeLoadException, ObjectDisposedException, UnauthorizedAccessException, IOException
- Throws:
Throwable
ArgumentNullException
ArgumentException
InvalidOperationException
IndexOutOfRangeException
SecurityException
NotSupportedException
ArgumentOutOfRangeException
ApplicationException
CultureNotFoundException
TypeLoadException
ObjectDisposedException
UnauthorizedAccessException
IOException
-
Create
public static RSA Create(int keySizeInBits) throws Throwable, ArgumentNullException, ArgumentException, InvalidOperationException, IndexOutOfRangeException, ArgumentOutOfRangeException, NotSupportedException, SecurityException, ApplicationException, CultureNotFoundException, TypeLoadException, ObjectDisposedException, UnauthorizedAccessException, IOException, CryptographicException
- Throws:
Throwable
ArgumentNullException
ArgumentException
InvalidOperationException
IndexOutOfRangeException
ArgumentOutOfRangeException
NotSupportedException
SecurityException
ApplicationException
CultureNotFoundException
TypeLoadException
ObjectDisposedException
UnauthorizedAccessException
IOException
CryptographicException
-
Create
public static RSA Create(RSAParameters parameters) throws Throwable, ArgumentNullException, ArgumentException, InvalidOperationException, IndexOutOfRangeException, ArgumentOutOfRangeException, NotSupportedException, SecurityException, ApplicationException, CultureNotFoundException, TypeLoadException, ObjectDisposedException, UnauthorizedAccessException, IOException
- Throws:
Throwable
ArgumentNullException
ArgumentException
InvalidOperationException
IndexOutOfRangeException
ArgumentOutOfRangeException
NotSupportedException
SecurityException
ApplicationException
CultureNotFoundException
TypeLoadException
ObjectDisposedException
UnauthorizedAccessException
IOException
-
CreateNewRSA
public static RSA CreateNewRSA(String algName) throws Throwable, ArgumentNullException, ArgumentException, InvalidOperationException, IndexOutOfRangeException, ArgumentOutOfRangeException, NotSupportedException, SecurityException, ApplicationException, CultureNotFoundException, TypeLoadException, ObjectDisposedException, UnauthorizedAccessException, IOException
- Throws:
Throwable
ArgumentNullException
ArgumentException
InvalidOperationException
IndexOutOfRangeException
ArgumentOutOfRangeException
NotSupportedException
SecurityException
ApplicationException
CultureNotFoundException
TypeLoadException
ObjectDisposedException
UnauthorizedAccessException
IOException
-
ExportParameters
public RSAParameters ExportParameters(boolean includePrivateParameters) throws Throwable
- Throws:
Throwable
-
ToXmlString
public String ToXmlString(boolean includePrivateParameters) throws Throwable, ArgumentNullException, FormatException, ArgumentOutOfRangeException, ArgumentException, InvalidOperationException, OutOfMemoryException, IndexOutOfRangeException
-
FromXmlString
public void FromXmlString(String xmlString) throws Throwable, ArgumentNullException, ArgumentException, FormatException, XmlSyntaxException, ArgumentOutOfRangeException, CultureNotFoundException, OutOfMemoryException, NotSupportedException, NullReferenceException, CryptographicException
-
ImportParameters
public void ImportParameters(RSAParameters parameters) throws Throwable
- Throws:
Throwable
-
-