Github

Download version 1.4.6: Windows or Linux

Text Library: RSA Public-key Encryption Extensions

Extends Colin LeMahieu's arbitrary precision integer library to conform to some RSA standards. The most important is the ability to read key-pairs conforming to the X509 PKCS1 standard. The top level class to access these facilities is EL_MODULE_X509_COMMAND.

The private key reader however uses a non-standard encryption scheme. It assumes the file is encrypted using the Eiffel-Loop utility contained in el_toolkit. See class CRYPTO_APP for details.

ECF: public-key-encryption.ecf

Directory: library/text/encryption/rsa

[ . ]

. /x509

. /x509/spec/common

[ . ]

EL_CRYPTO_COMMAND_SHELL

Menu driven console command shell

EL_RANDOM_SEED_INTEGER_X

Object to time seed random state

EL_MODULE_RSA

EL_RSA_KEY

EL_RSA_KEY_PAIR

EL_RSA_PRIVATE_KEY

EL_RSA_PUBLIC_KEY

EL_RSA_ROUTINES

x509

EL_PKCS1_RSA_FORMAT_CONSTANTS

PKCS1 RSA Constants

RSAPrivateKey ::= SEQUENCE {
    version           Version,
    modulus           INTEGER,  -- n
    publicExponent    INTEGER,  -- e
    privateExponent   INTEGER,  -- d
    prime1            INTEGER,  -- p
    prime2            INTEGER,  -- q
    exponent1         INTEGER,  -- d mod (p-1)
    exponent2         INTEGER,  -- d mod (q-1)
    coefficient       INTEGER,  -- (inverse of q) mod p
    otherPrimeInfos   OtherPrimeInfos OPTIONAL
}

EL_PKCS1_RSA_PRIVATE_KEY_READER

Class to read PKCS1 RSA private key

Information

RSAPrivateKey ::= SEQUENCE {
    version           Version,
    modulus           INTEGER,  -- n
    publicExponent    INTEGER,  -- e
    privateExponent   INTEGER,  -- d
    prime1            INTEGER,  -- p
    prime2            INTEGER,  -- q
    exponent1         INTEGER,  -- d mod (p-1)
    exponent2         INTEGER,  -- d mod (q-1)
    coefficient       INTEGER,  -- (inverse of q) mod p
    otherPrimeInfos   OtherPrimeInfos OPTIONAL
}

EL_X509_CERTIFICATE_READER_COMMAND_I

Parse public key from crt output text

SAMPLE CERTIFICATE

Certificate:

Data:
   Version: 3 (0x2)
   Serial Number: 13356565485226223335 (0xb95c0d8aee26e6e7)
Signature Algorithm: sha1WithRSAEncryption
   Issuer: C=IE, ST=Meath, L=Dunboyne, O=Yibook, OU=None,
                                    CN=Finnian/emailAddress=finnian@eiffel-loop.com
   Validity
      Not Before: May  2 12:48:51 2012 GMT
      Not After : Jan 27 12:48:51 2015 GMT
   Subject: C=IE, ST=Meath, L=Dunboyne, O=Yibook, OU=None,
                                    CN=Finnian/emailAddress=finnian@eiffel-loop.com
   Subject Public Key Info:
      Public Key Algorithm: rsaEncryption
         Public-Key: (1024 bit)
         Modulus:
            00:d9:61:6e:a7:03:21:2f:70:d2:22:38:d7:99:d4:
            bc:6d:55:7f:cc:97:9a:5d:8b:a3:d3:84:d3:2b:a2:
            1a:ba:67:3f:d5:17:68:e0:3d:a7:ed:23:5f:04:b6:
            8e:70:0d:f5:bc:d3:dd:03:cd:78:ec:4b:64:93:91:
            8a:4d:e5:d1:a9:01:4b:83:f9:2e:9c:a7:df:d8:6a:
            bc:1a:cf:80:f6:03:97:2a:a5:f8:1f:0e:02:81:51:
            14:cb:72:66:46:2a:b9:c2:f4:13:22:fd:d0:fc:4d:
            15:86:14:3b:5d:fc:25:65:26:31:5b:f9:d5:6d:a5:
            0d:26:e4:68:74:85:a7:0a:ad
         Exponent: 65537 (0x10001)

EL_X509_KEY_READER_COMMAND_I

Reads private key from X509 .key file

EL_MODULE_X509_COMMAND

EL_X509_COMMAND_FACTORY

x509/spec/common

EL_X509_CERTIFICATE_READER_COMMAND_IMP

Implementation of EL_X509_CERTIFICATE_READER_COMMAND_I interface

EL_X509_KEY_READER_COMMAND_IMP

Implementation of EL_X509_KEY_READER_COMMAND_I interface