I am taking a shot in the dark with this code.
working on generating keypairs Private/Public. With Erels help I was able to get the Key in numeric with dashes but not letters. Therefore not able to get the keys in a true PKCS#8 format.
The server I am connecting to will not accept the key in its current state with dashes.
With the code below I keep getting and error "java.lang.ArrayIndexOutOfBoundsException: length=1; index=1"
No matter what number I put in.
I could not find any further examples of the code.
Dim Formats(1,0) As String
Dim kpg As KeyPairGenerator
Dim MyKeyB(0) As Byte
Dim MyKeyC(0) As List
Dim MyKeyD(1) As Byte
Dim MyKeyE(1) As List
kpg.Initialize("RSA",128)
kpg.GenerateKey
MyKeyB = kpg.PrivateKeyToBytes
kpg.PrivateKeyFromBytes(MyKeyB)
MyKeyC(0) = kpg.PrivateKey
MyKeyD = kpg.PublicKeyToBytes
kpg.PublicKeyFromBytes(MyKeyD)
MyKeyE(1) = kpg.PublicKey
Is this correct or am I going about this all wrong?
Thanks for any Help.