manpagez: man pages & more
info bigloo
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15.2.1.1 RSA Keys

There are two kinds of RSA keys inside Bigloo: complete and partial keys. A complete key contains the information of both the public and the private key (together with other information that could be reconstructed out of the private key). A partial key just contains the modulus and the private or public exponent.

Bigloo Cryptography class: RSA-Key
Bigloo Cryptography class: Complete-RSA-Key
(class Rsa-Key modulus::bignum exponent::bignum)
(final-class Complete-Rsa-Key::Rsa-Key
  ;; for the complete-rsa-key "exponent" takes the role of 'd'
  e::bignum p::bignum q::bignum
  exp1::bignum   ;; d mod (p-1)
  exp2::bignum   ;; d mod (q-1)
  coeff::bignum) ;; (inverse of q) mod p

RSA keys can be read and written using read-pem-key and write-pem-key (PEM).

Bigloo Cryptography procedure: generate-rsa-key [:key 1024] [:show-trace]

This function generates a new RSA key (with its public and private components).

Do not use this function for critical applications. No special effort has been undertaken to guarantee the randomness of the generated prime numbers, nor to weed out insecure keys.

Complete keys can be accessed using the following functions:

Bigloo Cryptography procedure: extract-public-rsa-key complete-key

Returns the public partial key of the given complete key.

This procedure is implemented as follows:

(define (extract-public-rsa-key::Rsa-Key key::Complete-Rsa-Key)
   (with-access::Complete-Rsa-Key key (modulus e)
      (make-Rsa-Key modulus e)))
Bigloo Cryptography procedure: extract-private-rsa-key complete-key

Returns the private partial key of the given complete key.

Bigloo Cryptography procedure: rsa-key=? key1 key2

Returns true if the two keys have the same modulus and public exponent. The exponent of a partial key is considered to be public.

Bigloo Cryptography procedure: rsa-key-length key

Returns the key length in bytes.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on October 23, 2011 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.