RSA Control
Properties Methods Events Configuration Settings Errors
Implements RSA public-key cryptography to encrypt/decrypt and sign/verify messages.
Syntax
RSA
Remarks
The RSA control implements RSA public-key cryptography to encrypt/decrypt messages and sign/verify hash signatures.
To begin you must either specify an existing key or create a new key. Existing private keys may be specified by setting the Key* properties. To create a new key call CreateKey. Alternatively an existing certificate may be specified by setting the Certificate* properties
Signing
To sign data first set Key or Certificate. Specify the input data using InputFile or InputMessage. Next call Sign. The control will populate HashValue and HashSignature. After calling Sign the public key must be sent to the recipient along with HashSignature.
Encrypting
To encrypt data set RecipientKey or RecipientCert. Specify the input data using InputFile or InputMessage. Next call Encrypt. The control will populate OutputMessage, or write to the file specified by OutputFile.
Signature Verification
To verify a signature specify the input data using InputFile or InputMessage. Set SignerKey or SignerCert. Next set HashSignature and call VerifySignature. The VerifySignature method will return True if the signature was successfully verified.
Decrypting
To decrypt data first set Key or Certificate. Specify the input data using InputFile or InputMessage. Next call Decrypt. The control will populate OutputMessage, or write to the file specified by OutputFile.
Input and Output Properties
The control will determine the source and destination of the input and output based on which properties are set.
The order in which the input properties are checked is as follows:
When a valid source is found the search stops. The order in which the output properties are checked is as follows:- OutputFile
- OutputMessage: The output data is written to this property if no other destination is specified.
RSA Keys
A RSA key is made up of a number of individual parameters.
The public key consists of the following parameters:
The control also includes the KeyPublicKey property which holds the PEM formatted public key for ease of use. This is helpful if you are in control of both sides of the encryption/signing and decryption/signature verification process. When sending the public key to a recipient note that not all implementations will support using the PEM formatted value in KeyPublicKey in which case the individual parameters must be sent.
The private key may be represented in one of two ways. Both are mathematically equivalent. Private key format 1:
Private key format 2 is simpler but has decreased performance when decrypting and signing. This format is: The control also include the KeyPrivateKey property which holds the PEM formatted private key for ease of use. This is helpful for storing the private key more easily.Property List
The following is the full list of the properties of the control with short descriptions. Click on the links for further details.
CertEncoded | The certificate (PEM/base64 encoded). |
CertStore | The name of the certificate store for the client certificate. |
CertStorePassword | If the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store. |
CertStoreType | The type of certificate store for this certificate. |
CertSubject | The subject of the certificate used for client authentication. |
HashAlgorithm | The hash algorithm used for signing and signature verification. |
HashSignature | The hash signature. |
HashValue | The hash value of the data. |
InputFile | The file to process. |
InputMessage | The message to process. |
KeyD | Represents the D parameter for the RSA algorithm. |
KeyDP | Represents the DP parameter for the RSA algorithm. |
KeyDQ | Represents the DQ parameter for the RSA algorithm. |
KeyExponent | Represents the Exponent parameter for the RSA algorithm. |
KeyInverseQ | Represents the InverseQ parameter for the RSA algorithm. |
KeyModulus | Represents the Modulus parameter for the RSA algorithm. |
KeyP | Represents the P parameter for the RSA algorithm. |
KeyPrivateKey | This property is a PEM formatted private key. |
KeyPublicKey | This property is a PEM formatted public key. |
KeyQ | Represents the Q parameter for the RSA algorithm. |
OutputFile | The output file. |
OutputMessage | The output message after processing. |
Overwrite | Indicates whether or not the component should overwrite files. |
RecipientCertEncoded | The certificate (PEM/base64 encoded). |
RecipientCertStore | The name of the certificate store for the client certificate. |
RecipientCertStorePassword | If the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store. |
RecipientCertStoreType | The type of certificate store for this certificate. |
RecipientCertSubject | The subject of the certificate used for client authentication. |
RecipientKeyExponent | Represents the Exponent parameter for the RSA algorithm. |
RecipientKeyModulus | Represents the Modulus parameter for the RSA algorithm. |
RecipientKeyPublicKey | This property is a PEM formatted public key. |
SignerCertEncoded | The certificate (PEM/base64 encoded). |
SignerCertStore | The name of the certificate store for the client certificate. |
SignerCertStorePassword | If the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store. |
SignerCertStoreType | The type of certificate store for this certificate. |
SignerCertSubject | The subject of the certificate used for client authentication. |
SignerKeyExponent | Represents the Exponent parameter for the RSA algorithm. |
SignerKeyModulus | Represents the Modulus parameter for the RSA algorithm. |
SignerKeyPublicKey | This property is a PEM formatted public key. |
UseHex | Whether input or output is hex encoded. |
Method List
The following is the full list of the methods of the control with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting . |
CreateKey | Creates a new key. |
Decrypt | Decrypts the input data using the specified private key. |
Encrypt | Encrypts the input data using the recipient's public key. |
Reset | Resets the component. |
Sign | Creates a hash signature. |
VerifySignature | Verifies the signature for the specified data. |
Event List
The following is the full list of the events fired by the control with short descriptions. Click on the links for further details.
Error | Information about errors during data delivery. |
Progress | Fired as progress is made. |
Configuration Settings
The following is a list of configuration settings for the control with short descriptions. Click on the links for further details.
UseOAEP | Whether to use Optimal Asymmetric Encryption Padding (OAEP). |
OAEPParams | The hex encoded OAEP parameters. |
MGF1HashAlgorithm | The MGF1 hash algorithm used with OAEP. |
KeySize | The size, in bits, of the secret key. |
KeyFormat | How the public and private key are formatted. |
CodePage | The system code page used for Unicode to Multibyte translations. |