Re: Using the SSL module.
Trilok Tourani <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <CA+9+xUZqFgbcrdG-omqry6wY6druViBN8EbmYtq3RmYUvBz24w@mail.gmail.com> |
I have used the https.pike in pike 8 which is a example of a client/server connection. Some of the websites its working, but for some it says bad certificate chain. Does that mean, the websites certificate chain needs to be fixed? or is there any other way one can do it? Thanks. Regards Trilok Tourani On Mon, Jun 29, 2015 at 10:31 PM, Chris Angelico <[email protected]> wrote: > On Tue, Jun 30, 2015 at 2:36 AM, Henrik Grubbström <[email protected]> > wrote: > > It looks like a simple SSH-specific encoding. From looking at your > example, > > I believe that something like the following might work: > > > > Stdio.Buffer buf = Stdio.Buffer(MIME.decode_base64(encoded_key)); > > > > string tag = buf->read_hstring(4); > > > > if (tag == "ssh-rsa") { > > int modulo = buf->read_hint(4); > > > > int pub = buf->read_hint(4); > > > > Crypto.RSA rsa = Crypto.RSA(); > > > > rsa->set_public_key(modulo, pub); > > > > return rsa; > > > > } > > Thanks! I don't know much about crypto, so all I can do is try it out. > It seems that the public exponent comes first in the encoded version, > so I switched those two read_hint() lines, and then it appears to work > - the key can successfully verify signatures created with the > corresponding private key. This looks a lot better than "rip these > bytes off, shove those bytes on, and see how it goes". > > ChrisA > >