Libraries
PKCS #1 Source Code
 previous   up   next 

Types
rsaKeyPair
Type to describe a pair of RSA keys (private key and public key).

rsaKeyPair

const type: rsaKeyPair

Type to describe a pair of RSA keys (private key and public key).


Function Summary
rsaKey
rsaKey (in bigInteger: modulus, in bigInteger: exponent)
Generate an RSA key (private or public) from modulus and exponent.
rsaKeyPair
rsaKeyPair (in rsaKey: publicKey, in rsaKey: privateKey)
Generate an RSA key pair from publicKey and privateKey.
rsaKeyPair
rsaKeyPair (in bigInteger: modulus, in bigInteger: publicExponent, in bigInteger: privateExponent)
Generate an RSA key pair from modulus, publicExponent and privateExponent.
rsaKeyPair
genRsaKeyPair (in integer: keyLength, in bigInteger: exponent)
Generate a new RSA keyPair (private key and public key).
string
int2Octets (in bigInteger: number, in integer: length)
Convert a nonnegative bigInteger to an octet string of a specified length (I2OSP).
bigInteger
octets2int (in string: stri)
Convert an octet string to a nonnegative bigInteger (OS2IP).
string
emeOaepEncoding (in string: message, in string: label, in integer: modulusLen)
Encodes a string with the EME-OAEP encoding.
string
emeOaepDecoding (in string: encodedMessage, in string: label, in integer: modulusLen)
Decodes an EME-OAEP encoded string.
string
emePkcs1V15Encoding (in string: message, in integer: modulusLen)
Encodes a string with the EME-PKCS1-v1_5 encoding.
string
emePkcs1V15Decoding (in string: encodedMessage, in integer: modulusLen)
Decodes an EME-PKCS1-v1_5 encoded string.
string
emsaPkcs1V15Encoding (in string: message, in integer: modulusLen)
Encodes a string with the EMSA-PKCS1-v1_5 encoding.
string
emsaPkcs1V15Decoding (in string: encodedMessage)
Decodes an EMSA-PKCS1-v1_5 encoded string.
bigInteger
rsaEncrypt (in rsaKey: encryptionKey, in bigInteger: message)
Encrypts a bigInteger with the RSAES encryption.
bigInteger
rsaDecrypt (in rsaKey: decryptionKey, in bigInteger: ciphertext)
Decrypts a bigInteger with the RSADP decryption.
string
rsaesOaepEncrypt (in rsaKey: encryptionKey, in string: message, in string: label)
Encrypts a string of bytes with the RSAES-OAEP encryption.
string
rsaesOaepDecrypt (in rsaKey: decryptionKey, in string: ciphertext, in string: label)
Decrypts a string of bytes with the RSAES-OAEP decryption.
string
rsaesPkcs1V15Encrypt (in rsaKey: encryptionKey, in string: message)
Encrypts a string of bytes with the RSAES-PKCS1-V1_5 encryption.
string
rsaesPkcs1V15Decrypt (in rsaKey: decryptionKey, in string: ciphertext)
Decrypts a string of bytes with the RSAES-PKCS1-V1_5 decryption.
string
rsassaPkcs1V15Encrypt (in rsaKey: encryptionKey, in string: message)
Encrypts a string of bytes with the RSASSA-PKCS1-V1_5 encryption.
string
rsassaPkcs1V15Decrypt (in rsaKey: decryptionKey, in string: ciphertext)
Decrypts a string of bytes with the RSASSA-PKCS1-V1_5 decryption.

Function Detail

rsaKey

const func rsaKey: rsaKey (in bigInteger: modulus, in bigInteger: exponent)

Generate an RSA key (private or public) from modulus and exponent.


rsaKeyPair

const func rsaKeyPair: rsaKeyPair (in rsaKey: publicKey, in rsaKey: privateKey)

Generate an RSA key pair from publicKey and privateKey.


rsaKeyPair

const func rsaKeyPair: rsaKeyPair (in bigInteger: modulus, in bigInteger: publicExponent, in bigInteger: privateExponent)

Generate an RSA key pair from modulus, publicExponent and privateExponent.


genRsaKeyPair

const func rsaKeyPair: genRsaKeyPair (in integer: keyLength, in bigInteger: exponent)

Generate a new RSA keyPair (private key and public key).


int2Octets

const func string: int2Octets (in bigInteger: number, in integer: length)

Convert a nonnegative bigInteger to an octet string of a specified length (I2OSP).

Returns:
an octet string with the big-endian representation.
Raises:
RANGE_ERROR - If the result does not fit into length.

octets2int

const func bigInteger: octets2int (in string: stri)

Convert an octet string to a nonnegative bigInteger (OS2IP).

Returns:
a nonnegative bigInteger created from the big-endian bytes.
Raises:
RANGE_ERROR - If characters beyond '\255;' are present.

emeOaepEncoding

const func string: emeOaepEncoding (in string: message, in string: label, in integer: modulusLen)

Encodes a string with the EME-OAEP encoding.

Returns:
the EME-OAEP encoded string.

emeOaepDecoding

const func string: emeOaepDecoding (in string: encodedMessage, in string: label, in integer: modulusLen)

Decodes an EME-OAEP encoded string.

Returns:
the decoded string.
Raises:
RANGE_ERROR - If encodedMessage is not in the EME-OAEP format.

emePkcs1V15Encoding

const func string: emePkcs1V15Encoding (in string: message, in integer: modulusLen)

Encodes a string with the EME-PKCS1-v1_5 encoding.

Returns:
the EME-PKCS1-v1_5 encoded string.

emePkcs1V15Decoding

const func string: emePkcs1V15Decoding (in string: encodedMessage, in integer: modulusLen)

Decodes an EME-PKCS1-v1_5 encoded string.

Returns:
the decoded string.
Raises:
RANGE_ERROR - If encodedMessage is not in the EME-PKCS1-v1_5 format.

emsaPkcs1V15Encoding

const func string: emsaPkcs1V15Encoding (in string: message, in integer: modulusLen)

Encodes a string with the EMSA-PKCS1-v1_5 encoding.

Returns:
the EMSA-PKCS1-v1_5 encoded string.

emsaPkcs1V15Decoding

const func string: emsaPkcs1V15Decoding (in string: encodedMessage)

Decodes an EMSA-PKCS1-v1_5 encoded string.

Returns:
the decoded string.
Raises:
RANGE_ERROR - If encodedMessage is not in the EME-PKCS1-v1_5 format.

rsaEncrypt

const func bigInteger: rsaEncrypt (in rsaKey: encryptionKey, in bigInteger: message)

Encrypts a bigInteger with the RSAES encryption.

Returns:
the RSAES encrypted bigInteger.
Raises:
RANGE_ERROR - If message is too big for the RSAEP encryption.

rsaDecrypt

const func bigInteger: rsaDecrypt (in rsaKey: decryptionKey, in bigInteger: ciphertext)

Decrypts a bigInteger with the RSADP decryption.

Returns:
the RSADP decrypted bigInteger.
Raises:
RANGE_ERROR - If ciphertext is too big for the RSADP decryption.

rsaesOaepEncrypt

const func string: rsaesOaepEncrypt (in rsaKey: encryptionKey, in string: message, in string: label)

Encrypts a string of bytes with the RSAES-OAEP encryption.

Returns:
the RSAES-OAEP encrypted string of bytes.
Raises:
RANGE_ERROR - If the length of the message is too long to be encrypted.
RANGE_ERROR - If message contains characters beyond '\255;'.

rsaesOaepDecrypt

const func string: rsaesOaepDecrypt (in rsaKey: decryptionKey, in string: ciphertext, in string: label)

Decrypts a string of bytes with the RSAES-OAEP decryption.

Returns:
the RSAES-OAEP decrypted string of bytes.
Raises:
RANGE_ERROR - If the length of the ciphertext is too long to be decrypted.
RANGE_ERROR - If ciphertext contains characters beyond '\255;'.

rsaesPkcs1V15Encrypt

const func string: rsaesPkcs1V15Encrypt (in rsaKey: encryptionKey, in string: message)

Encrypts a string of bytes with the RSAES-PKCS1-V1_5 encryption.

Returns:
the RSAES-PKCS1-V1_5 encrypted string of bytes.
Raises:
RANGE_ERROR - If the length of the message is too long to be encrypted.
RANGE_ERROR - If message contains characters beyond '\255;'.

rsaesPkcs1V15Decrypt

const func string: rsaesPkcs1V15Decrypt (in rsaKey: decryptionKey, in string: ciphertext)

Decrypts a string of bytes with the RSAES-PKCS1-V1_5 decryption.

Returns:
the RSAES-PKCS1-V1_5 decrypted string of bytes.
Raises:
RANGE_ERROR - If the length of the ciphertext is too long to be decrypted.
RANGE_ERROR - If ciphertext contains characters beyond '\255;'.

rsassaPkcs1V15Encrypt

const func string: rsassaPkcs1V15Encrypt (in rsaKey: encryptionKey, in string: message)

Encrypts a string of bytes with the RSASSA-PKCS1-V1_5 encryption.

Returns:
the RSASSA-PKCS1-V1_5 encrypted string of bytes.
Raises:
RANGE_ERROR - If the length of the message is too long to be encrypted.
RANGE_ERROR - If message contains characters beyond '\255;'.

rsassaPkcs1V15Decrypt

const func string: rsassaPkcs1V15Decrypt (in rsaKey: decryptionKey, in string: ciphertext)

Decrypts a string of bytes with the RSASSA-PKCS1-V1_5 decryption.

Returns:
the RSASSA-PKCS1-V1_5 decrypted string of bytes.
Raises:
RANGE_ERROR - If the length of the ciphertext is too long to be decrypted.
RANGE_ERROR - If ciphertext contains characters beyond '\255;'.


 previous   up   next