[prev in list] [next in list] [prev in thread] [next in thread]
List: bouncycastle-crypto-dev
Subject: Re: [dev-crypto] Importing an existing certificate into TLSClient
From: Lili Shi <lilidotshi () gmail ! com>
Date: 2011-09-06 14:50:48
Message-ID: CAFA-72YSmWmCwHQULYOmLraduvrtNxidez8GvdNwi+10ExW95g () mail ! gmail ! com
[Download RAW message or body]
Thanks so much for your help Pete. Everything is working great now!
On Sep 1, 2011 9:14 AM, "Peter Dettman" <pkd@lockboxlabs.com> wrote:
> Great. So just call getEncoded() on the private key, which with the BC
> provider will produce a PKCS#8 encoding (check getFormat() if using
> another provider to make sure). Pass the resulting byte[] to
> org.bouncycastle.crypto.util.PrivateKeyFactory.createKey and it should
> return you an AsymmetricKeyParameter.
>
>
> On 1/09/2011 7:42 PM, Lili Shi wrote:
>>
>> My private key is stored in the bks.
>>
>> On Sep 1, 2011 8:39 AM, "Peter Dettman" <pkd@lockboxlabs.com
>> <mailto:pkd@lockboxlabs.com>> wrote:
>> > The AsymmetricKeyParameter has to be the private key corresponding to
>> > your certificate.
>> > How to create the appropriate object will depend on what format you
>> have
>> > the private key available in. So, where is your private key coming
from?
>> >
>> > Cheers,
>> > Pete.
>> >
>> >
>> > On 1/09/2011 7:29 PM, LilidotShi@gmail.com
>> <mailto:LilidotShi@gmail.com> wrote:
>> >> Thanks so much for your help Pete!
>> >>
>> >> I think I'm starting to get the hang of this but I have one more
>> >> question. Creating an instance of DefaultTlsSignerCredentials means
>> >> supplying it with a TLscontext, a clientcert and an
>> >> AsymmetricKeyParameters. I can get the first two, TlsContext, like you
>> >> said is created for me, clientCert I got by converting the certificate
>> >> but how do I create/access AsymmetricKeyParameters, particularly if I
>> >> know it's going to be an instance of elliptic curve parameters?
>> >>
>> >> Again, sorry to bombard you with all these questions but I think once
>> >> I get past this I should be able to make a successful handshake.
>> >>
>> >> Lili
>> >
>> >
>
[Attachment #3 (text/html)]
<p>Thanks so much for your help Pete. Everything is working great now!</p>
<div class="gmail_quote">On Sep 1, 2011 9:14 AM, "Peter Dettman" <<a \
href="mailto:pkd@lockboxlabs.com">pkd@lockboxlabs.com</a>> wrote:<br \
type="attribution">> Great. So just call getEncoded() on the private key, which \
with the BC <br> > provider will produce a PKCS#8 encoding (check getFormat() if \
using <br>> another provider to make sure). Pass the resulting byte[] to <br>> \
org.bouncycastle.crypto.util.PrivateKeyFactory.createKey and it should <br> > \
return you an AsymmetricKeyParameter.<br>> <br>> <br>> On 1/09/2011 7:42 PM, \
Lili Shi wrote:<br>>><br>>> My private key is stored in the \
bks.<br>>><br>>> On Sep 1, 2011 8:39 AM, "Peter Dettman" <<a \
href="mailto:pkd@lockboxlabs.com">pkd@lockboxlabs.com</a> <br> >> <mailto:<a \
href="mailto:pkd@lockboxlabs.com">pkd@lockboxlabs.com</a>>> wrote:<br>>> \
> The AsymmetricKeyParameter has to be the private key corresponding \
to<br>>> > your certificate.<br> >> > How to create the appropriate \
object will depend on what format you <br>>> have<br>>> > the private \
key available in. So, where is your private key coming from?<br>>> \
><br>>> > Cheers,<br> >> > Pete.<br>>> ><br>>> \
><br>>> > On 1/09/2011 7:29 PM, <a \
href="mailto:LilidotShi@gmail.com">LilidotShi@gmail.com</a> <br>>> \
<mailto:<a href="mailto:LilidotShi@gmail.com">LilidotShi@gmail.com</a>> \
wrote:<br> >> >> Thanks so much for your help Pete!<br>>> \
>><br>>> >> I think I'm starting to get the hang of this but I \
have one more<br>>> >> question. Creating an instance of \
DefaultTlsSignerCredentials means<br> >> >> supplying it with a \
TLscontext, a clientcert and an<br>>> >> AsymmetricKeyParameters. I can \
get the first two, TlsContext, like you<br>>> >> said is created for me, \
clientCert I got by converting the certificate<br> >> >> but how do I \
create/access AsymmetricKeyParameters, particularly if I<br>>> >> know \
it's going to be an instance of elliptic curve parameters?<br>>> \
>><br>>> >> Again, sorry to bombard you with all these questions \
but I think once<br> >> >> I get past this I should be able to make a \
successful handshake.<br>>> >><br>>> >> Lili<br>>> \
><br>>> ><br>> <br></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic