CkRsa Python Programming
Reference Documentation

CkRsa

RSA encryption component / library. Encrypt and decrypt byte arrays and strings. Generate public/private key pairs from 384 to 4096 bits in length. Import and export RSA keys. Import keys from SNK files. Input/output in raw binary, base64, hex encoding, quoted-printable, URL-encoding, etc.

Object Creation

obj = chilkat.CkRsa()

Properties

# out is a CkString object (output)
get_Charset( out )

# str is a string (input)
put_Charset( str )

This property only applies when encrypting, decrypting, signing, or verifying signatures for strings. When encrypting strings, the input string is first converted to this charset before encrypting.

When decrypting, the decrypted data is interpreted as a string with this charset encoding and converted to the appropriate return. For example, ActiveX's returning strings always return Unicode (2 bytes/char). Java strings are utf-8. Chilkat C++ strings are ANSI or utf-8. .NET strings are Unicode.

When signing string data, the input string is first converted to this charset before being hashed and signed. When verifying the signature for string data, the input string is first converted to this charset before the verification process begins.

# out is a CkString object (output)
get_EncodingMode( out )

# str is a string (input)
put_EncodingMode( str )

Encoding mode to be used in methods ending in "ENC", such as EncryptStringENC. Valid EncodingModes are "base64", "hex", "url", or "quoted-printable" (or "qp"). Encryption methods ending in "ENC" will return encrypted data as a string encoded according to this property's value. Decryption methods ending in "ENC" accept an encoded string as specified by this property. The string is first decoded and then decrypted. The default value is "base64".

This property also applies to the "ENC" methods for creating and verifying digital signatures.

# str is a CkString object (output)
LastErrorHtml( str )

Error information in HTML format for the last method called.

# str is a CkString object (output)
LastErrorText( str )

Error information in plain-text format for the last method called.

# str is a CkString object (output)
LastErrorXml( str )

Error information in XML format for the last method called.

# Returns a boolean value
get_LittleEndian( )

# newVal is a boolean (input)
put_LittleEndian( newVal )

The default value is True, which means that signatures and encrypted output will be created using the little-endian byte ordering, which is what Microsoft's Crypto API produces. To produce big-endian output, set the property equal to False. Chilkat RSA is capable of reading and verifying either little-endian or big-endian signatures, regardless of this setting. When decrypting, this property's value must match the byte ordering used when encrypting.

To match OpenSSL results, set this property to False

# Returns a boolean value
get_NoUnpad( )

# newVal is a boolean (input)
put_NoUnpad( newVal )

If True, skips unpadding when decrypting. The default is False. This property value is typically left unchanged.

# Returns an integer value
get_NumBits( )

The number of bits of the key generated or imported into this RSA encryption object. Keys ranging in size from 384 bits to 4096 bits can be generated by calling GenerateKey. A public or private key may be imported by calling ImportPublicKey or ImportPrivateKey. A key must be available either via GenerateKey or import before any of the encrypt/decrypt methods may be called.

# Returns a boolean value
get_OaepPadding( )

# newVal is a boolean (input)
put_OaepPadding( newVal )

Controls whether Optimal Asymmetric Encryption Padding (OAEP) is used for the padding scheme (for encrypting/decrypting). If set to False, PKCS1 v1.5 padding is used. If set to True, PKCS1 v2.0 (OAEP) padding is used.

When creating digital signatures, this property controls whether RSA-PSS or PKCS1 v1.5 is used. If True, then the RSA-PSS signature scheme is used.

# Returns a boolean value
get_Utf8( )

# b is a boolean (input)
put_Utf8( b )

When set to true, all "const char *" arguments are expected to be utf-8 strings. If set to false, the "const char *" arguments are expected to be ANSI strings.

# Returns a boolean value
get_VerboseLogging( )

# newVal is a boolean (input)
put_VerboseLogging( newVal )

To be documented soon...

# str is a CkString object (output)
get_Version( str )

Returns the version of the component as a string, such as "2.0.0".

Methods

# inData is a CkByteData object (input)
# usePrivateKey is a boolean (input)
# out is a CkByteData object (output)
# Returns a boolean value
DecryptBytes( inData, usePrivateKey, out )

Decrypts byte data using the RSA encryption algorithm. usePrivateKey should be set to True if the private key is to be used for decrypting. Otherwise it should be set to False if the public key is to be used for decrypting.

Important: If trying to match OpenSSL results, set the LittleEndian property = False.

# str is a string (input)
# bUsePrivateKey is a boolean (input)
# out is a CkByteData object (output)
# Returns a boolean value
DecryptBytesENC( str, bUsePrivateKey, out )

Same as DecryptBytes, except the input is an encoded string. The encoding is specified by the EncodingMode property, which can have values such as "base64", "hex", "quoted-printable", "url", etc.

Important: If trying to match OpenSSL results, set the LittleEndian property = False.

# binarySig is a CkByteData object (input)
# usePrivateKey is a boolean (input)
# out is a CkString object (output)
# Returns a boolean value
DecryptString( binarySig, usePrivateKey, out )

Decrypts encrypted string data and returns an unencrypted string. usePrivateKey should be set to True if the private key is to be used for decrypting. Otherwise it should be set to False if the public key is to be used. The Charset property controls how the component interprets the decrypted string. Depending on the programming language, strings are returned to the application as Unicode, utf-8, or ANSI. Internal to DecryptString, the decrypted string is automatically converted from the charset specified by the Charset property to the encoding required by the calling programming language.

Important: If trying to match OpenSSL results, set the LittleEndian property = False.

Returns True for success, False for failure.

# encodedSig is a string (input)
# usePrivateKey is a boolean (input)
# out is a CkString object (output)
# Returns a boolean value
DecryptStringENC( encodedSig, usePrivateKey, out )

Same as DecryptString, except the input is an encoded string. The encoding is specified by the EncodingMode property, which can have values such as "base64", "hex", "quoted-printable", "url", etc.

Important: If trying to match OpenSSL results, set the LittleEndian property = False.

Returns True for success, False for failure.

# binaryData is a CkByteData object (input)
# usePrivateKey is a boolean (input)
# out is a CkByteData object (output)
# Returns a boolean value
EncryptBytes( binaryData, usePrivateKey, out )

Encrypts byte data using the RSA encryption algorithm. usePrivateKey should be set to True if the private key is to be used for encrypting. Otherwise it should be set to False if the public key is to be used for encrypting.

Important: If trying to match OpenSSL results, set the LittleEndian property = False.

# bData is a CkByteData object (input)
# bUsePrivateKey is a boolean (input)
# out is a CkString object (output)
# Returns a boolean value
EncryptBytesENC( bData, bUsePrivateKey, out )

Same as EncryptBytes, except the output is an encoded string. The encoding is specified by the EncodingMode property, which can have values such as "base64", "hex", "quoted-printable", "url", etc.

Important: If trying to match OpenSSL results, set the LittleEndian property = False.

Returns True for success, False for failure.

# stringToSign is a string (input)
# usePrivateKey is a boolean (input)
# out is a CkByteData object (output)
# Returns a boolean value
EncryptString( stringToSign, usePrivateKey, out )

Encrypts a string using the RSA encryption algorithm. usePrivateKey should be set to True if the private key is to be used for encrypting. Otherwise it should be set to False if the public key is to be used for encrypting. The string is first converted (if necessary) to the character encoding specified by the Charset property before encrypting. The encrypted bytes are returned.

Important: If trying to match OpenSSL results, set the LittleEndian property = False.

# str is a string (input)
# bUsePrivateKey is a boolean (input)
# out is a CkString object (output)
# Returns a boolean value
EncryptStringENC( str, bUsePrivateKey, out )

Same as EncryptString, except the output is an encoded string. The encoding is specified by the EncodingMode property, which can have values such as "base64", "hex", "quoted-printable", "url", etc.

Important: If trying to match OpenSSL results, set the LittleEndian property = False.

Returns True for success, False for failure.

# strXml is a CkString object (output)
# Returns a boolean value
ExportPrivateKey( strXml )

Exports the private-key of an RSA key pair to XML format. This is typically called after generating a new RSA key via the GenerateKey method.

Returns True for success, False for failure.

# strXml is a CkString object (output)
# Returns a boolean value
ExportPublicKey( strXml )

Exports the public-key of an RSA key pair to XML format. This is typically called after generating a new RSA key via the GenerateKey method.

Returns True for success, False for failure.

# numBits is an integer (input)
# Returns a boolean value
GenerateKey( numBits )

Generates a new RSA public/private key pair. The number of bits can range from 384 to 4096. Typical key lengths are 1024 or 2048 bits. After successful generation, the public/private parts of the key can be exported to XML via the ExportPrivateKey and ExportPublicKey methods.

Returns True for success, False for failure.

# xmlKey is a string (input)
# Returns a boolean value
ImportPrivateKey( xmlKey )

Imports a private key from XML format. After successful import, the private key can be used to encrypt or decrypt. A private key (by definition) contains both private and public parts. This is because the public key consist of modulus and exponent. The private key consists of modulus, exponent, P, Q, DP, DQ, InverseQ, and D:

<RSAKeyValue>
  <Modulus>...</Modulus>
  <Exponent>...</Exponent>
  <P>...</P>
  <Q>...</Q>
  <DP>...</DP>
  <DQ>...</DQ>
  <InverseQ>...</InverseQ>
  <D>...</D>
</RSAKeyValue>

Important: The Rsa object can contain either a private key or a public key, but not both. Importing a private key overwrites the existing key regardless of whether the type of key is public or private.

Returns True for success, False for failure.

# xmlKey is a string (input)
# Returns a boolean value
ImportPublicKey( xmlKey )

Imports a public key from XML format. After successful import, the public key can be used to encrypt or decrypt.

Note: Importing a public key overwrites the key that is currently contained in this object - even if it's a private key.

A public key consists of modulus and exponent:

<RSAKeyValue>
  <Modulus>...</Modulus>
  <Exponent>...</Exponent>
</RSAKeyValue>

Important: The Rsa object can contain either a private key or a public key, but not both. Importing a private key overwrites the existing key regardless of whether the type of key is public or private.

Returns True for success, False for failure.

# data is a CkByteData object (output)
# outBytes is a CkByteData object (output)
# Returns a boolean value
OpenSslSignBytes( data, outBytes )

Duplicates OpenSSL's rsautl utility for creating RSA signatures. Input data consists of binary bytes, and returns the signature bytes.

Duplicating OpenSSL rsautl (creating RSA signatures)

# data is a CkByteData object (output)
# outStr is a CkString object (output)
# Returns a boolean value
OpenSslSignBytesENC( data, outStr )

Duplicates OpenSSL's rsautl utility for creating RSA signatures. Input data consists of binary bytes, and returns the signature as a string encoded according to the EncodingMode property (base64, hex, etc.).

Returns True for success, False for failure.

# str is a string (input)
# outBytes is a CkByteData object (output)
# Returns a boolean value
OpenSslSignString( str, outBytes )

Duplicates OpenSSL's rsautl utility for creating RSA signatures. Input data is a string, and returns the signature bytes.

# str is a string (input)
# outStr is a CkString object (output)
# Returns a boolean value
OpenSslSignStringENC( str, outStr )

Duplicates OpenSSL's rsautl utility for creating RSA signatures. Input data is a string, and returns the signature as a string encoded according to the EncodingMode property (base64, hex, etc.).

Returns True for success, False for failure.

Duplicating OpenSSL rsautl (creating RSA signatures)

# signature is a CkByteData object (output)
# outBytes is a CkByteData object (output)
# Returns a boolean value
OpenSslVerifyBytes( signature, outBytes )

Duplicates OpenSSL's rsautl utility for verifying RSA signatures and recovering the original data. Input data consists of the raw signature bytes and returns the original bytes.

Duplicating OpenSSL rsautl (creating RSA signatures)

# str is a string (input)
# outBytes is a CkByteData object (output)
# Returns a boolean value
OpenSslVerifyBytesENC( str, outBytes )

Duplicates OpenSSL's rsautl utility for verifying RSA signatures and recovering the original data. Input data is a signature string encoded according to the EncodingMode property (base64, hex, etc.). Returns the original bytes.

# data is a CkByteData object (output)
# outStr is a CkString object (output)
# Returns a boolean value
OpenSslVerifyString( data, outStr )

Duplicates OpenSSL's rsautl utility for verifying RSA signatures and recovering the original data. Input data consists of the raw signature bytes and returns the original string.

Returns True for success, False for failure.

# str is a string (input)
# outStr is a CkString object (output)
# Returns a boolean value
OpenSslVerifyStringENC( str, outStr )

Duplicates OpenSSL's rsautl utility for verifying RSA signatures and recovering the original data. Input data is a signature string encoded according to the EncodingMode property (base64, hex, etc.). Returns the original string.

Returns True for success, False for failure.

Duplicating OpenSSL rsautl (creating RSA signatures)

# filename is a string (input)
# Returns a boolean value
SaveLastError( filename )

Saves the last error information to an XML formatted file.

# binaryData is a CkByteData object (input)
# hashAlgorithm is a string (input)
# out is a CkByteData object (output)
# Returns a boolean value
SignBytes( binaryData, hashAlgorithm, out )

Creates an RSA digital signature by hashing binaryData and then signing the hash. The hash algorithm is specified by hashAlgorithm, which may be "SHA-1", "MD5", "MD2", "SHA-256", "SHA-384", or "SHA-512". The recommended hash algorithm is "SHA-1".

Important: If trying to match OpenSSL results, set the LittleEndian property = False. (The LittleEndian property should also be set to False to match Amazon web services, such as CloudFront.)

A private key is required to create a digital signature.

An error is indicated when a byte array of 0 length is returned.

# binaryData is a CkByteData object (input)
# hashAlgorithm is a string (input)
# out is a CkString object (output)
# Returns a boolean value
SignBytesENC( binaryData, hashAlgorithm, out )

Creates an RSA digital signature by hashing binaryData and then signing the hash. The hash algorithm is specified by hashAlgorithm, which may be "SHA-1", "MD5", "MD2", "SHA-256", "SHA-384", or "SHA-512". The recommended hash algorithm is "SHA-1". The digital signature is returned as an encoded string, where the encoding is specified by the EncodingMode property.

Important: If trying to match OpenSSL results, set the LittleEndian property = False. (The LittleEndian property should also be set to False to match Amazon web services, such as CloudFront.)

A private key is required to create a digital signature.

An error is indicated when null reference is returned.

Returns True for success, False for failure.

# hashBytes is a CkByteData object (output)
# hashAlg is a string (input)
# outBytes is a CkByteData object (output)
# Returns a boolean value
SignHash( hashBytes, hashAlg, outBytes )

To be documented soon...

# encodedHash is a string (input)
# hashAlg is a string (input)
# outStr is a CkString object (output)
# Returns a boolean value
SignHashENC( encodedHash, hashAlg, outStr )

To be documented soon.

Returns True for success, False for failure.

# strToBeHashed is a string (input)
# hashAlgorithm is a string (input)
# out is a CkByteData object (output)
# Returns a boolean value
SignString( strToBeHashed, hashAlgorithm, out )

Creates an RSA digital signature by hashing strToBeHashed and then signing the hash. The hash algorithm is specified by hashAlgorithm, which may be "SHA-1", "MD5", "MD2", "SHA-256", "SHA-384", or "SHA-512". The recommended hash algorithm is "SHA-1".

Important: If trying to match OpenSSL results, set the LittleEndian property = False. (The LittleEndian property should also be set to False to match Amazon web services, such as CloudFront.)

A private key is required to create a digital signature.

An error is indicated when a byte array of 0 length is returned.

# strToBeHashed is a string (input)
# hashAlgorithm is a string (input)
# out is a CkString object (output)
# Returns a boolean value
SignStringENC( strToBeHashed, hashAlgorithm, out )

Creates an RSA digital signature by hashing strToBeHashed and then signing the hash. The hash algorithm is specified by hashAlgorithm, which may be "SHA-1", "MD5", "MD2", "SHA-256", "SHA-384", or "SHA-512". The recommended hash algorithm is "SHA-1". The digital signature is returned as an encoded string, where the encoding is specified by the EncodingMode property.

Important: If trying to match OpenSSL results, set the LittleEndian property = False. (The LittleEndian property should also be set to False to match Amazon web services, such as CloudFront.)

A private key is required to create a digital signature.

An error is indicated when null reference is returned.

Returns True for success, False for failure.

Example Code: Create RSA Signature with PEM Private Key

# filename is a string (input)
# strXml is a CkString object (output)
# Returns a boolean value
SnkToXml( filename, strXml )

Imports a .snk file to an XML document that can be imported via the ImportPrivateKey method.

Returns True for success, False for failure.

# unlockCode is a string (input)
# Returns a boolean value
UnlockComponent( unlockCode )

Unlocks the component. This must be called once prior to calling any other method.

Returns True for success, False for failure.

# originalData is a CkByteData object (input)
# hashAlgorithm is a string (input)
# signatureBytes is a CkByteData object (input)
# Returns a boolean value
VerifyBytes( originalData, hashAlgorithm, signatureBytes )

Verifies an RSA digital signature. Returns True if the signature is valid for the originalData. The hashAlgorithm may be "SHA-1", "MD5", "MD2", "SHA-256", "SHA-384", or "SHA-512". The recommended hash algorithm is "SHA-1".

# originalData is a CkByteData object (input)
# hashAlgorithm is a string (input)
# encodedSig is a string (input)
# Returns a boolean value
VerifyBytesENC( originalData, hashAlgorithm, encodedSig )

Verifies an RSA digital signature. Returns True if the signature is valid for the originalData. The hashAlgorithm may be "SHA-1", "MD5", "MD2", "SHA-256", "SHA-384", or "SHA-512". The recommended hash algorithm is "SHA-1".

The encodedSig is a digital signature encoded according to the EncodingMode property (i.e. base64, hex, etc.).

# hashBytes is a CkByteData object (output)
# hashAlg is a string (input)
# sigBytes is a CkByteData object (output)
# Returns a boolean value
VerifyHash( hashBytes, hashAlg, sigBytes )

To be documented soon...

# encodedHash is a string (input)
# hashAlg is a string (input)
# encodedSig is a string (input)
# Returns a boolean value
VerifyHashENC( encodedHash, hashAlg, encodedSig )

To be documented soon...

# xml is a string (input)
# Returns a boolean value
VerifyPrivateKey( xml )

To be documented soon.

Returns True for success, False for failure.

# originalString is a string (input)
# hashAlgorithm is a string (input)
# binarySig is a CkByteData object (input)
# Returns a boolean value
VerifyString( originalString, hashAlgorithm, binarySig )

Verifies an RSA digital signature. Returns True if the signature is valid for the originalString. The hashAlgorithm may be "SHA-1", "MD5", "MD2", "SHA-256", "SHA-384", or "SHA-512". The recommended hash algorithm is "SHA-1".

# originalString is a string (input)
# hashAlgorithm is a string (input)
# encodedSig is a string (input)
# Returns a boolean value
VerifyStringENC( originalString, hashAlgorithm, encodedSig )

Verifies an RSA digital signature. Returns True if the signature is valid for the originalString. The hashAlgorithm may be "SHA-1", "MD5", "MD2", "SHA-256", "SHA-384", or "SHA-512". The recommended hash algorithm is "SHA-1".

The encodedSig is a digital signature encoded according to the EncodingMode property (i.e. base64, hex, etc.).

# Returns a string
charset( )

This property only applies when encrypting, decrypting, signing, or verifying signatures for strings. When encrypting strings, the input string is first converted to this charset before encrypting.

When decrypting, the decrypted data is interpreted as a string with this charset encoding and converted to the appropriate return. For example, ActiveX's returning strings always return Unicode (2 bytes/char). Java strings are utf-8. Chilkat C++ strings are ANSI or utf-8. .NET strings are Unicode.

When signing string data, the input string is first converted to this charset before being hashed and signed. When verifying the signature for string data, the input string is first converted to this charset before the verification process begins.

Returns a null on failure

# binarySig is a CkByteData object (input)
# usePrivateKey is a boolean (input)
# Returns a string
decryptString( binarySig, usePrivateKey )

Decrypts encrypted string data and returns an unencrypted string. usePrivateKey should be set to True if the private key is to be used for decrypting. Otherwise it should be set to False if the public key is to be used. The Charset property controls how the component interprets the decrypted string. Depending on the programming language, strings are returned to the application as Unicode, utf-8, or ANSI. Internal to DecryptString, the decrypted string is automatically converted from the charset specified by the Charset property to the encoding required by the calling programming language.

Important: If trying to match OpenSSL results, set the LittleEndian property = False.

Returns a null on failure

# encodedSig is a string (input)
# usePrivateKey is a boolean (input)
# Returns a string
decryptStringENC( encodedSig, usePrivateKey )

Same as DecryptString, except the input is an encoded string. The encoding is specified by the EncodingMode property, which can have values such as "base64", "hex", "quoted-printable", "url", etc.

Important: If trying to match OpenSSL results, set the LittleEndian property = False.

Returns a null on failure

# Returns a string
encodingMode( )

Encoding mode to be used in methods ending in "ENC", such as EncryptStringENC. Valid EncodingModes are "base64", "hex", "url", or "quoted-printable" (or "qp"). Encryption methods ending in "ENC" will return encrypted data as a string encoded according to this property's value. Decryption methods ending in "ENC" accept an encoded string as specified by this property. The string is first decoded and then decrypted. The default value is "base64".

This property also applies to the "ENC" methods for creating and verifying digital signatures.

Returns a null on failure

# data is a CkByteData object (input)
# bUsePrivateKey is a boolean (input)
# Returns a string
encryptBytesENC( data, bUsePrivateKey )

Same as EncryptBytes, except the output is an encoded string. The encoding is specified by the EncodingMode property, which can have values such as "base64", "hex", "quoted-printable", "url", etc.

Important: If trying to match OpenSSL results, set the LittleEndian property = False.

Returns a null on failure

# str is a string (input)
# bUsePrivateKey is a boolean (input)
# Returns a string
encryptStringENC( str, bUsePrivateKey )

Same as EncryptString, except the output is an encoded string. The encoding is specified by the EncodingMode property, which can have values such as "base64", "hex", "quoted-printable", "url", etc.

Important: If trying to match OpenSSL results, set the LittleEndian property = False.

Returns a null on failure

# Returns a string
exportPrivateKey( )

Exports the private-key of an RSA key pair to XML format. This is typically called after generating a new RSA key via the GenerateKey method.

Returns a null on failure

# Returns a string
exportPublicKey( )

Exports the public-key of an RSA key pair to XML format. This is typically called after generating a new RSA key via the GenerateKey method.

Returns a null on failure

# Returns a string
lastErrorHtml( )

Error information in HTML format for the last method called.

Returns a null on failure

# Returns a string
lastErrorText( )

Error information in plain-text format for the last method called.

Returns a null on failure

# Returns a string
lastErrorXml( )

Error information in XML format for the last method called.

Returns a null on failure

# data is a CkByteData object (output)
# Returns a string
openSslSignBytesENC( data )

Duplicates OpenSSL's rsautl utility for creating RSA signatures. Input data consists of binary bytes, and returns the signature as a string encoded according to the EncodingMode property (base64, hex, etc.).

Returns a null on failure

# str is a string (input)
# Returns a string
openSslSignStringENC( str )

Duplicates OpenSSL's rsautl utility for creating RSA signatures. Input data is a string, and returns the signature as a string encoded according to the EncodingMode property (base64, hex, etc.).

Returns a null on failure

Duplicating OpenSSL rsautl (creating RSA signatures)

# data is a CkByteData object (output)
# Returns a string
openSslVerifyString( data )

Duplicates OpenSSL's rsautl utility for verifying RSA signatures and recovering the original data. Input data consists of the raw signature bytes and returns the original string.

Returns a null on failure

# str is a string (input)
# Returns a string
openSslVerifyStringENC( str )

Duplicates OpenSSL's rsautl utility for verifying RSA signatures and recovering the original data. Input data is a signature string encoded according to the EncodingMode property (base64, hex, etc.). Returns the original string.

Returns a null on failure

Duplicating OpenSSL rsautl (creating RSA signatures)

# binaryData is a CkByteData object (input)
# hashAlgorithm is a string (input)
# Returns a string
signBytesENC( binaryData, hashAlgorithm )

Creates an RSA digital signature by hashing binaryData and then signing the hash. The hash algorithm is specified by hashAlgorithm, which may be "SHA-1", "MD5", "MD2", "SHA-256", "SHA-384", or "SHA-512". The recommended hash algorithm is "SHA-1". The digital signature is returned as an encoded string, where the encoding is specified by the EncodingMode property.

Important: If trying to match OpenSSL results, set the LittleEndian property = False. (The LittleEndian property should also be set to False to match Amazon web services, such as CloudFront.)

A private key is required to create a digital signature.

An error is indicated when null reference is returned.

Returns a null on failure

# encodedHash is a string (input)
# hashAlg is a string (input)
# Returns a string
signHashENC( encodedHash, hashAlg )

To be documented soon.

Returns a null on failure

# strToBeHashed is a string (input)
# hashAlgorithm is a string (input)
# Returns a string
signStringENC( strToBeHashed, hashAlgorithm )

Creates an RSA digital signature by hashing strToBeHashed and then signing the hash. The hash algorithm is specified by hashAlgorithm, which may be "SHA-1", "MD5", "MD2", "SHA-256", "SHA-384", or "SHA-512". The recommended hash algorithm is "SHA-1". The digital signature is returned as an encoded string, where the encoding is specified by the EncodingMode property.

Important: If trying to match OpenSSL results, set the LittleEndian property = False. (The LittleEndian property should also be set to False to match Amazon web services, such as CloudFront.)

A private key is required to create a digital signature.

An error is indicated when null reference is returned.

Returns a null on failure

Example Code: Create RSA Signature with PEM Private Key

# filename is a string (input)
# Returns a string
snkToXml( filename )

Imports a .snk file to an XML document that can be imported via the ImportPrivateKey method.

Returns a null on failure

# Returns a string
version( )

Returns the version of the component as a string, such as "2.0.0".

Returns a null on failure