Question... about importing private key
Nikos Mavrogiannopoulos
nmav at gnutls.org
Wed Dec 23 16:07:19 CET 2009
Kyung a Lee wrote:
Now it not that much of a private key :) Anyway I was able to parse it
with certtool -k and see its contents. Which version of gnutls do you use?
regards,
Nikos
> Hi,
>
>
>
> I wanna import x509 private key (RSA), but it returns -69,
>
> I follow the sources, and found that occurred from asn1_create_element. In
> this status, they
>
> Returns ASN1_ELEMENT_NOT_FOUND..
>
> I used this funcs for parse private key:
>
> Gnutls_x509_privkey_init(&priv_key);
>
> Gnutls_x509_privkey_import(priv_key, &key, GNUTLS_X509_FMT_PEM)
>
>
>
> And this is the contents of key file:
>
> -----BEGIN RSA PRIVATE KEY-----
>
> MIICXAIBAAKBgQC80PsdzO8ghbLAYRFsgzNLbHThfZ/s7akgiBgDnE/kFDO032Sl
>
> MfidvuR9Y78wIhjOcRf8rufIZS1yanMATf2lZy2TqKdm7UGmwcf9ciUlISG4uwF4
>
> NrZOYmPJPbVy6zf/bRLy5OFwijAIK/E3kC9wUhTB9j1wo/qUNrzeYVW5rQIDAQAB
>
> AoGAU2I+46QzHjus+wRi+3bdWjulSkd+LtWt0O4JHN8U8PZy9zeIbOOqlY9NvIom
>
> To1gQxryquZa+cak0VhtPP80Oess4umL4SFUCii7kH8/ReImP8aDUHritjg5GLZg
>
> p7BqvYkLsmVWlq4TcYy4JPMkURy55MeLgNN0XHUsXsin9ckCQQDcmzwfXJ40EHt1
>
> 3XT3NqM3CreMefrKbRGIJ8cJgcApos+HtxTwHXalBwWW+MayUweasyRtlCaJqGLn
>
> UpDRXZbHAkEA2xwP50ZolQ6/crbHAlZSxjHOdMlX1CwS6uerYiHZEH8cFZuX5HI1
>
> 0yr1mHnVIBVMs/VIZOf7Q+arkuEzmewn6wJAD5XP+485hggcEMmid8yeX0ccjIoZ
>
> k69865eT0jIed1KPQtFGY2hRd3s1g+LzdqmzAdTiH/O1fUguJJWKsZ/hBQJBAJCZ
>
> 1XkJQ23TvM9FBtNpCtmX9yul0RvKNnXmjHmH4wv7BxrPg4+VPCZvfIOzK88vn15I
>
> aw2E95MZQXP+waI8cx8CQFteO0k/kuUqpYYjjtTzFEjP2m4aB0aEhRx6cTJoK86g
>
> 05T+6QkBjdGhPKkLOoFtqZFO9qIZWvRvgKE081cMiLg=
>
> -----END RSA PRIVATE KEY-----
More information about the Gnutls-devel
mailing list