PB 2019 Build 2170
I'm trying to generate RSA public/private keys which are stored in the database. They are then used by our C# .Net web application.
The C# developer I am working with tells me the public key from the below code is X.509 formatted. He is unsure what the private key format is. He says that X.509 is not the usual format.
What is the format of the private key? Has anyone been able to do this using CryptoAPI or BCrypt Windows API functions?
CrypterObject lnv_CrypterObject
CoderObject lnv_CoderObject
Integer li_return
Blob lblb_privKey, lblb_pubKey
lnv_CrypterObject = Create CrypterObject
lnv_CoderObject = Create CoderObject
// Generate the keys
li_return = lnv_CrypterObject.AsymmetricGenerateKey(RSA!, 2048, lblb_privKey, lblb_pubKey)
If li_return = 1 Then
// convert blobs to Base64 strings
as_privKey = lnv_CoderObject.Base64Encode(lblb_privKey)
as_pubKey = lnv_CoderObject.Base64Encode(lblb_pubKey)
Else
Return False
End If
Return True