(Lianja) DSA Get Key as XML
Gets the DSA key in XML format.
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loDsa = createobject("CkDsa")
// Generate a new 2048 bit DSA key.
llSuccess = loDsa.GenKey(2048)
if (llSuccess <> .T.) then
? loDsa.LastErrorText
release loDsa
return
endif
// Get the public key as XML
llBPublicOnly = .T.
lcXmlStr = loDsa.ToXml(llBPublicOnly)
? lcXmlStr
// Sample output.
// <DSAKeyValue>
// <P>wBYOKu...2eoXw==</P>
// <Q>1taJI7...kV2/9c=</Q>
// <G>qjfbTi...eB1+g==</G>
// <Y>t3tz...NqjsPEg==</Y>
// </DSAKeyValue>
// Get the private key as XML.
llBPublicOnly = .F.
lcXmlStr = loDsa.ToXml(llBPublicOnly)
? lcXmlStr
// Sample output.
// <DSAKeyValue>
// <P>wBYOKu...2eoXw==</P>
// <Q>1taJI7...kV2/9c=</Q>
// <G>qjfbTi...eB1+g==</G>
// <Y>t3tz...NqjsPEg==</Y>
// <X>lm9F...XzuVO+qU=</X>
// </DSAKeyValue>
release loDsa
|