You will find that in the Crypto++ manual: http://www.cryptopp.com/docs/ref/
Have a look at this page: http://www.cryptopp.com/docs/ref/class_invertible_r_s_a_function.html In particular the member function "GetModPrime1PrivateExponent()" and the two functions below it. The keys are stored in ASN1 format. If you want to visualize them, you can use openssl: $ openssl asn1parse -in filename -inform DER -i -strparse 22 0:d=0 hl=4 l= 890 cons: SEQUENCE 4:d=1 hl=2 l= 1 prim: INTEGER :00 7:d=1 hl=3 l= 193 prim: INTEGER :B0DECF4F5313DA8B5B64567D46DD72F20BC72E30E9B0482A56677489C77EA58E2C6F8CCBD84ACB95BE35BC92482A04D44967FC1B116FECBBFCA84F60CBF35E3393EFF6A4F9FAA5916167628D0A2F50ABC8435060A86A48FA5507322E5150D77D1C98E203AC506E9D0DC163366B1A0E4FBE5AC74A7519309A39C5A207873637BFD8CEDC18C7F10B5B19763ABA450B7A224A2A8DDDE2719B2D8BBD86ECBCD4ABEE4ECDA47E4AD0D4E8258BA31359D6ED559846417C4F88ECD804D573D272A8D60F 203:d=1 hl=2 l= 1 prim: INTEGER :11 206:d=1 hl=3 l= 192 prim: INTEGER :0A67759B411F4917419C7D8EE60D06C2F1A24E02E091E6209BABBB8FA252BE71C660EA2A1BC82A17DE032935C80278C1317E965BF1F78665693713BA66599C2126D1E154FFA555088D4251175AF3B973844031E7916FA9F09B9702F3AA6E2ACB06B7B37ACA1EDEE9149DF574C7F6EF3CCBB95C183402AF53D43F14119ABF42C363A5F6D2488F15CB41644A3CC49AA73790DD12CA12E3F6866DAA8E0D3774D439E0E0B4D53F45D18D1A7ED2311966619F778BD76E0819AE9385DF4AE14623CEE1 401:d=1 hl=2 l= 97 prim: INTEGER :E26E3200EF5FF675A0B0C1520D5A88EA450B2979619D093E2B300A4065AD31C398BFB691247F7527A0EF4F73F01A0DB1B80C0431B50C81F6910B53F566467F352DC5DCAFF9A86C503CA837CEF2648CF06B404F8BC1575C43CCFEB28BA205EE37 500:d=1 hl=2 l= 97 prim: INTEGER :C7F7C4DB50E3AAAD0E9355231659A25BF20080359F4E82CAF665429BDAD59702A209C190D1F123B420DDFD3D46AC51BFF3704A40EC41BA49B25EC416A7CC14E1321BC5A51D857E3926777601B7A5E4CE3CBCA3A2047CF8C85402C85128422AE9 599:d=1 hl=2 l= 96 prim: INTEGER :5D3C6EF15381DDF4331B9AE58D07295167B94D5019228B55D58C4074DE929C053EE58768F0E9303D7E80A83ECC46F69478F5E39BFF4162B0D24FF5650BFEE915E5ABD35784EAFF6C55363518FA65A3720E0B6C0C5EAB8058273BB2EE33A816CB 697:d=1 hl=2 l= 97 prim: INTEGER :8D275DC7FCDCF0F2A0E0785500B7BDE68CB50F34E8EC2016CC0B3E13A987B5E3BDAC88A27613A0BB627E94A3B96A940F0631255B011F5652238E300FFDF978267DB940385112EFAFDEEAE9E31838DDBEC1761927123A1905E0F2E7C0D11FA5D1 796:d=1 hl=2 l= 96 prim: INTEGER :3E45812D1CEFBDCDF56357276F36783C004D035144B71B480A596EF725BC50CE52C8CFC2DE246662CF724120B0A2A6A64D7B74E6D6C309FB3E46E2689B71605BB59289088BA2FB96C839CDC02BE3C9BDB1269CA94D5F6BEE1A75E334207ED56D The components of this "ASN1 sequence" are: version number, n, e, d, p, q, d mod (p-1), q mod (q-1), (q^(-1)) mod p. cft --- En date de : Lun 29.3.10, Alan Cooper <[email protected]> a écrit : > De: Alan Cooper <[email protected]> > Objet: RSA public/private key parameters > À: "Crypto++ Users" <[email protected]> > Date: Lundi 29 mars 2010, 15h23 > Someone kindly pointed out a post to > me that shows how to get the key > parameters. Something like: > > AutoSeededRandomPool rng; > > InvertibleRSAFunction params; > params.GenerateRandomWithKeySize( rng, 1536 ); > > Integer n = params.GetModulus(); > Integer p = params.GetPrime1(); > Integer q = params.GetPrime2(); > Integer d = params.GetPrivateExponent(); > Integer e = params.GetPublicExponent(); > > What I need is to get generate the XML form of the keys, as > done > in .Net. What I'm missing is DP, DQ an InverseQ. > > Is this possible with Crypto++? > > Thanks > > -- > You received this message because you are subscribed to the > "Crypto++ Users" Google Group. > To unsubscribe, send an email to [email protected]. > More information about Crypto++ and this group is available > at http://www.cryptopp.com. > > To unsubscribe from this group, send email to > cryptopp-users+unsubscribegooglegroups.com or reply to this > email with the words "REMOVE ME" as the subject. > -- You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. To unsubscribe from this group, send email to cryptopp-users+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
