1.1 --- a/MYPublicKey.h Sun Apr 19 21:19:35 2009 -0700
1.2 +++ b/MYPublicKey.h Sat Jun 06 15:36:35 2009 -0700
1.3 @@ -48,6 +48,24 @@
1.4 * Advanced methods.
1.5 */
1.6 //@{
1.7 +
1.8 +/** Initializes a public key directly from its raw RSA modulus and exponent.
1.9 + These numbers must come from an existing key-pair generated by the RSA algorithm;
1.10 + you CANNOT just pass in random data and create a working key! (To create a new key pair,
1.11 + call -[MYKeychain generateRSAKeyPairOfSize:].)
1.12 + @param modulus RSA modulus, a very large integer represented as a blob of big-endian data.
1.13 + @param exponent RSA exponent, a prime number, commonly 17 or 65537.
1.14 +*/
1.15 +- (id) initWithModulus: (NSData*)modulus exponent: (unsigned)exponent;
1.16 +
1.17 +/** Retrieves the raw RSA modulus and exponent, which together uniquely specify the key.
1.18 + The length of the modulus is the size, in bits, of the key: for example, a 2048-bit key
1.19 + has 256 bytes of modulus data.
1.20 + @param outModulus On return, will contain the modulus: a very large positive integer represented
1.21 + as a blob of unsigned big-endian data.
1.22 + @param outExponent On return, will contain the exponent: a prime number, often 17 or 65537. */
1.23 +- (BOOL) getModulus: (NSData**)outModulus exponent: (unsigned*)outExponent;
1.24 +
1.25 #if !TARGET_OS_IPHONE
1.26
1.27 /** Encrypts a session key using this public key.