[Bulk] Re: [Bulk] [xmlsec] Re: Loaded Private Key and mscrypto

Edward Shallow ed.shallow at rogers.com
Thu Jan 19 15:37:13 PST 2006

With attachments ... 

-----Original Message-----
From: Edward Shallow [mailto:ed.shallow at rogers.com] 
Sent: January 19, 2006 6:36 PM
To: 'Aleksey Sanin'
Cc: 'xmlsec at aleksey.com'
Subject: RE: [Bulk] Re: [Bulk] [xmlsec] Re: Loaded Private Key and mscrypto

Hi Aleksey,

Confirmed that problem in xmlSecSimpleKeysStoreSave is indeed with mscrypto.
Openssl works fine. Python ctypes works fine using all of c_uint(1) for
Public, c_uint(2) for Private, c_uint(4) for Symmetric, and sums thereof.
Only selected key types saved in each case. c_uint(65535) produces equiv of
0x'FFFF' and selects all types. No problem here either.

Private Exponent comes out as would be expected for both test-rsa and p12
loaded key named 'Ed Shallow' using openssl. NOT for mscrypto.

savedKeysStore.xml for both openssl and mscrypto are attached.

    keysMngr = xmlsec.xmlSecKeysMngrCreate()
    rc = xmlsec.xmlSecCryptoAppDefaultKeysMngrInit(keysMngr)
    id = xmlsec.xmlSecSimpleKeysStoreGetKlass()
    keyStore = xmlsec.xmlSecKeyStoreCreate(id)
    rc = xmlsec.xmlSecSimpleKeysStoreLoad(keyStore,
'c:/xmlsec/keys/keys.xml', keysMngr)
    desKlass = xmlsec.xmlSecKeyDataDesGetKlass()
    symmetricKey = xmlsec.xmlSecKeyGenerateByName(desKlass.contents.name,
c_uint(192), c_uint(12))
    rc = xmlsec.xmlSecKeySetName(symmetricKey, 'symmetric-des')
    rc = xmlsec.xmlSecSimpleKeysStoreAdoptKey(keyStore, symmetricKey)
    privateKey = xmlsec.xmlSecCryptoAppKeyLoad(p12, c_uint(6), password,
None, None)
    print 'xmlSecKeySetName\t\t\tstatus code',
xmlsec.xmlSecKeySetName(privateKey, 'Ed Shallow')
    rc = xmlsec.xmlSecSimpleKeysStoreAdoptKey(keyStore, privateKey)
    rc = xmlsec.xmlSecKeysMngrAdoptKeysStore(keysMngr, keyStore)
    print 'KeysMngrAdoptKeysStore \t\t\tstatus code', rc
    rc = xmlsec.xmlSecSimpleKeysStoreSave(keyStore,
'c:/xmlsec/keys/savedKeysStore65535.xml', c_uint(65535))


-----Original Message-----
From: xmlsec-bounces at aleksey.com [mailto:xmlsec-bounces at aleksey.com] On
Behalf Of Aleksey Sanin
Sent: January 17, 2006 11:48 AM
To: ed.shallow at rogers.com
Cc: xmlsec at aleksey.com
Subject: [Bulk] Re: [Bulk] [xmlsec] Re: Loaded Private Key and mscrypto

>     rc = xmlsec.xmlSecSimpleKeysStoreSave(keyStore,
> 'c:/xmlsec/keys/savedKeysStore.xml', c_uint(65535))
>     print 'xmlSecSimpleKeysStoreSave \t\tstatus code', rc

c_uint(65535) is incorrect. Please set just private keys to be saved
(xmlSecKeyDataTypePrivate define).

xmlsec mailing list
xmlsec at aleksey.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: savedKeysStoreMScrypto65535.xml
Type: text/xml
Size: 4161 bytes
Desc: not available
Url : http://www.aleksey.com/pipermail/xmlsec/attachments/20060119/4e33888a/savedKeysStoreMScrypto65535-0002.xml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: savedKeysStoreOpenSSL65535.xml
Type: text/xml
Size: 4954 bytes
Desc: not available
Url : http://www.aleksey.com/pipermail/xmlsec/attachments/20060119/4e33888a/savedKeysStoreOpenSSL65535-0002.xml

More information about the xmlsec mailing list