I tried to use some of the code for my own webapp, so i found this small issue
- you convert the keypackage with an ASCII Encoder
- this destroys the keypackage and renders it unuseable, the KeyPackage is a binary, so with ASCII you loose 128 bit of each byte
i did then something like (i had to use vb.net for this project.. sorry sorry)
where the sContent is directly the LDAP value.