Yes, but the code will be crypto library specific. For example, for OpenSSL check these functions: http://www.aleksey.com/xmlsec/api/xmlsec-openssl-crypto.html#XMLSECOPENSSLKEYDATADSAGETDSA http://www.aleksey.com/xmlsec/api/xmlsec-openssl-crypto.html#XMLSECOPENSSLKEYDATARSAGETRSA Best, Aleksey